http1.1 keepalive drop ah betweentimes

https://github.com/warmcat/libwebsockets/issues/404

Tested with

wget -O- http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html

and confirm no connection processing during that on server side

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-29 09:06:22 +08:00
parent 9c444d2709
commit 6dd7e86f23

View file

@ -691,8 +691,11 @@ lws_http_transaction_completed(struct lws *wsi)
/* He asked for it to stay alive indefinitely */
lws_set_timeout(wsi, NO_PENDING_TIMEOUT, 0);
if (lws_allocate_header_table(wsi))
lwsl_info("On waiting list for header table");
/* if we still have the headers, drop them and reacquire a new ah when
* the new headers arrive. Otherwise we hog an ah indefinitely,
* needlessly.
*/
lws_free_header_table(wsi);
/* If we're (re)starting on headers, need other implied init */
wsi->u.hdr.ues = URIES_IDLE;