Skip to content
Snippets Groups Projects
Commit f4ffc1e2 authored by Andy Green's avatar Andy Green
Browse files

fixes for close flush

parent e7016aae
No related branches found
No related tags found
No related merge requests found
...@@ -153,9 +153,10 @@ handle_truncated_send: ...@@ -153,9 +153,10 @@ handle_truncated_send:
lwsl_info("***** %x partial send completed\n", wsi); lwsl_info("***** %x partial send completed\n", wsi);
/* done with it, but don't free it */ /* done with it, but don't free it */
n = real_len; 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); lwsl_info("***** %x signalling to close now\n", wsi);
return -1; /* retry closing now */ return -1; /* retry closing now */
}
} }
/* always callback on writeable */ /* always callback on writeable */
libwebsocket_callback_on_writable( libwebsocket_callback_on_writable(
......
...@@ -42,7 +42,12 @@ lws_handle_POLLOUT_event(struct libwebsocket_context *context, ...@@ -42,7 +42,12 @@ lws_handle_POLLOUT_event(struct libwebsocket_context *context,
} }
/* leave POLLOUT active either way */ /* leave POLLOUT active either way */
return 0; 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, m = lws_ext_callback_for_each_active(wsi, LWS_EXT_CALLBACK_IS_WRITEABLE,
NULL, 0); NULL, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment