plat win be robust against NULL wsi_from_fd 2

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-11-13 11:43:53 +08:00
parent 46d9b8e06f
commit 1064cd7619

View file

@ -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);
}