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

valgrind drop header allocation down http path

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-02-11 11:27:44 +08:00
parent 16ab3185c4
commit 4708a02f06

View file

@ -116,15 +116,23 @@ libwebsocket_read(struct libwebsocket_context *context,
if (!lws_hdr_total_length(wsi, WSI_TOKEN_UPGRADE) ||
!lws_hdr_total_length(wsi, WSI_TOKEN_CONNECTION)) {
wsi->state = WSI_STATE_HTTP;
n = 0;
if (wsi->protocol->callback)
if (wsi->protocol->callback(context, wsi,
n = wsi->protocol->callback(context, wsi,
LWS_CALLBACK_HTTP,
wsi->user_space,
lws_hdr_simple_ptr(wsi, WSI_TOKEN_GET_URI),
lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI))) {
lwsl_info("LWS_CALLBACK_HTTP wanted to close\n");
goto bail;
}
lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI));
/* drop the header info */
if (wsi->u.hdr.ah)
free(wsi->u.hdr.ah);
if (n) {
lwsl_info("LWS_CALLBACK_HTTP wanted to close\n");
goto bail;
}
return 0;
}