mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
fixes for close flush
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
e7016aae2b
commit
f4ffc1e215
2 changed files with 8 additions and 2 deletions
|
@ -153,9 +153,10 @@ handle_truncated_send:
|
|||
lwsl_info("***** %x partial send completed\n", wsi);
|
||||
/* done with it, but don't free it */
|
||||
n = real_len;
|
||||
if (wsi->state == WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE)
|
||||
if (wsi->state == WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE) {
|
||||
lwsl_info("***** %x signalling to close now\n", wsi);
|
||||
return -1; /* retry closing now */
|
||||
}
|
||||
}
|
||||
/* always callback on writeable */
|
||||
libwebsocket_callback_on_writable(
|
||||
|
|
|
@ -42,7 +42,12 @@ lws_handle_POLLOUT_event(struct libwebsocket_context *context,
|
|||
}
|
||||
/* leave POLLOUT active either way */
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
if (wsi->state == WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE) {
|
||||
lwsl_info("***** %x signalling to close in POLLOUT handler\n", wsi);
|
||||
return -1; /* retry closing now */
|
||||
}
|
||||
|
||||
|
||||
m = lws_ext_callback_for_each_active(wsi, LWS_EXT_CALLBACK_IS_WRITEABLE,
|
||||
NULL, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue