diff --git a/lib/core/private.h b/lib/core/private.h index a22d35fb4..778520f7c 100644 --- a/lib/core/private.h +++ b/lib/core/private.h @@ -560,7 +560,7 @@ struct lws_context_per_thread { struct lws_pollfd *fds; volatile struct lws_foreign_thread_pollfd * volatile foreign_pfd_list; #ifdef _WIN32 - WSAEVENT *events; + WSAEVENT events; #endif lws_sockfd_type dummy_pipe_fds[2]; struct lws *pipe_wsi; diff --git a/lib/plat/lws-plat-win.c b/lib/plat/lws-plat-win.c index 97afefa66..cd821714e 100644 --- a/lib/plat/lws-plat-win.c +++ b/lib/plat/lws-plat-win.c @@ -272,7 +272,7 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) lws_pt_unlock(pt); } - ev = WSAWaitForMultipleEvents(1, pt->events, FALSE, timeout_ms, FALSE); + ev = WSAWaitForMultipleEvents(1, &pt->events, FALSE, timeout_ms, FALSE); if (ev == WSA_WAIT_EVENT_0) { unsigned int eIdx, err; @@ -477,6 +477,9 @@ LWS_VISIBLE void lws_plat_delete_socket_from_fds(struct lws_context *context, struct lws *wsi, int m) { + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + pt->fds_count--; } LWS_VISIBLE void