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

avoid changing wrong revents if connection closed

parent 1963c9aa
No related branches found
No related tags found
No related merge requests found
...@@ -400,9 +400,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context, ...@@ -400,9 +400,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
if (m == our_fd) { if (m == our_fd) {
/* it was the guy we came to service! */ /* it was the guy we came to service! */
timed_out = 1; timed_out = 1;
/* mark as handled */ /* he's gone, no need to mark as handled */
if (pollfd)
pollfd->revents = 0;
} }
} }
} }
...@@ -619,7 +617,8 @@ close_and_handled: ...@@ -619,7 +617,8 @@ close_and_handled:
lwsl_debug("Close and handled\n"); lwsl_debug("Close and handled\n");
libwebsocket_close_and_free_session(context, wsi, libwebsocket_close_and_free_session(context, wsi,
LWS_CLOSE_STATUS_NOSTATUS); LWS_CLOSE_STATUS_NOSTATUS);
n = 1; // pollfd points to something else after the close
return 1;
handled: handled:
pollfd->revents = 0; pollfd->revents = 0;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment