1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ah pool take care about freeing headers after parsing

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-02-06 08:44:34 +08:00
parent 1b89b933a6
commit 99e876d8f7

View file

@ -304,8 +304,16 @@ lws_http_action(struct lws *wsi)
wsi->user_space, uri_ptr, uri_len);
}
/* now drop the header info we kept a pointer to */
lws_free_header_table(wsi);
/*
* If we are in keepalive, we may already have the next header set
* pipelined in the lws_read buffer above us... if so, we must hold
* the ah so it's still bound when we want to process the next headers.
*
*/
if (connection_type == HTTP_CONNECTION_CLOSE ||
!wsi->u.hdr.more_rx_waiting)
/* now drop the header info we kept a pointer to */
lws_free_header_table(wsi);
if (n) {
lwsl_info("LWS_CALLBACK_HTTP closing\n");