Skip to content
Snippets Groups Projects
Commit 66d466a1 authored by Carl Stehle's avatar Carl Stehle Committed by Andy Green
Browse files

http keepalive needs to reinit some header union state

AG moved the code to the keepalive loop location
parent b128cccc
Branches
No related tags found
No related merge requests found
...@@ -173,17 +173,23 @@ read_ok: ...@@ -173,17 +173,23 @@ read_ok:
http_complete: http_complete:
lwsl_debug("libwebsocket_read: http_complete\n"); lwsl_debug("libwebsocket_read: http_complete\n");
/* Handle keep-alives, by preparing for a new request: */
/* Did the client want to keep the HTTP connection going? */
if (wsi->u.http.connection_type == HTTP_CONNECTION_KEEP_ALIVE) { if (wsi->u.http.connection_type == HTTP_CONNECTION_KEEP_ALIVE) {
lwsl_debug("libwebsocket_read: keep-alive\n"); lwsl_debug("libwebsocket_read: keep-alive\n");
wsi->state = WSI_STATE_HTTP; wsi->state = WSI_STATE_HTTP;
wsi->mode = LWS_CONNMODE_HTTP_SERVING; wsi->mode = LWS_CONNMODE_HTTP_SERVING;
/* We might be streaming HTTP content, so leave the connection open.*/
/* He asked for it to stay alive indefinitely */
libwebsocket_set_timeout(wsi, NO_PENDING_TIMEOUT, 0); libwebsocket_set_timeout(wsi, NO_PENDING_TIMEOUT, 0);
if (lws_allocate_header_table(wsi)) if (lws_allocate_header_table(wsi))
goto bail; goto bail;
/* If we're (re)starting on headers, need other implied init */
wsi->u.hdr.ues = URIES_IDLE;
/* If we have more data, loop back around: */ /* If we have more data, loop back around: */
if (len) if (len)
goto http_new; goto http_new;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment