From 1064cd7619e65103904c0736d27de21a089868dd Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 13 Nov 2015 11:43:53 +0800 Subject: [PATCH] plat win be robust against NULL wsi_from_fd 2 Signed-off-by: Andy Green --- lib/lws-plat-win.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c index 5295679..afb640d 100644 --- a/lib/lws-plat-win.c +++ b/lib/lws-plat-win.c @@ -197,8 +197,10 @@ lws_plat_service(struct libwebsocket_context *context, int timeout_ms) pfd->revents = networkevents.lNetworkEvents; - if (pfd->revents & LWS_POLLOUT) - wsi_from_fd(context,pfd->fd)->sock_send_blocking = FALSE; + if (pfd->revents & LWS_POLLOUT) { + wsi = wsi_from_fd(context, pfd->fd); + wsi->sock_send_blocking = FALSE; + } return libwebsocket_service_fd(context, pfd); } -- 2.7.4