fix heap corruption if HTTP callback calls libwebsocket_close_and_free_session

Signed-off-by: Nick Dowell <nick@nickdowell.com>
This commit is contained in:
Nick Dowell 2012-04-05 10:29:29 +08:00 committed by Andy Green
parent fd96330920
commit f803c0d9df

View file

@ -596,11 +596,11 @@ libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi
if (!wsi->utf8_token[WSI_TOKEN_UPGRADE].token_len ||
!wsi->utf8_token[WSI_TOKEN_CONNECTION].token_len) {
wsi->state = WSI_STATE_HTTP;
if (wsi->protocol->callback)
(wsi->protocol->callback)(context, wsi,
LWS_CALLBACK_HTTP, wsi->user_space,
wsi->utf8_token[WSI_TOKEN_GET_URI].token, 0);
wsi->state = WSI_STATE_HTTP;
return 0;
}