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

peer closes during partial buffered just hang up

https://github.com/warmcat/libwebsockets/issues/573
This commit is contained in:
Andy Green 2016-07-02 09:23:15 +08:00
parent 81c221ed35
commit 8860eddeb2

View file

@ -1268,6 +1268,17 @@ spill:
/* if he sends us 2 CLOSE, kill him */
return -1;
if (lws_partial_buffered(wsi)) {
/*
* if we're in the middle of something,
* we can't do a normal close response and
* have to just close our end.
*/
wsi->socket_is_permanently_unusable = 1;
lwsl_parser("Closing on peer close due to Pending tx\n");
return -1;
}
if (user_callback_handle_rxflow(
wsi->protocol->callback, wsi,
LWS_CALLBACK_WS_PEER_INITIATED_CLOSE,