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

close if we tried to close politely just close next time

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-02-15 22:48:58 +08:00
parent 50097dd078
commit 22524a65a2

View file

@ -200,6 +200,10 @@ libwebsocket_close_and_free_session(struct libwebsocket_context *context,
if (old_state == WSI_STATE_DEAD_SOCKET)
return;
/* we tried the polite way... */
if (old_state == WSI_STATE_AWAITING_CLOSE_ACK)
goto just_kill_connection;
wsi->u.ws.close_reason = reason;
if (wsi->mode == LWS_CONNMODE_HTTP_SERVING && wsi->u.http.fd) {