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

close: make sure all paths capture original state

This commit is contained in:
Andy Green 2017-11-24 12:18:49 +08:00
parent 3031666dc7
commit e1cdb1f328

View file

@ -402,6 +402,8 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason)
goto async_close;
}
wsi->state_pre_close = wsi->state;
#ifdef LWS_WITH_CGI
if (wsi->mode == LWSCM_CGI) {
/* we are not a network connection, but a handler for CGI io */
@ -446,8 +448,6 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason)
wsi->state == LWSS_SHUTDOWN)
goto just_kill_connection;
wsi->state_pre_close = wsi->state;
switch (wsi->state_pre_close) {
case LWSS_DEAD_SOCKET:
return;