plat win be robust against NULL wsi_from_fd
After "haitetra" https://github.com/warmcat/libwebsockets/issues/343 Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
9ffb42efec
commit
46d9b8e06f
1 changed files with 3 additions and 1 deletions
|
@ -142,6 +142,7 @@ lws_plat_service(struct libwebsocket_context *context, int timeout_ms)
|
|||
DWORD ev;
|
||||
WSANETWORKEVENTS networkevents;
|
||||
struct libwebsocket_pollfd *pfd;
|
||||
struct libwebsocket *wsi;
|
||||
|
||||
/* stay dead once we are dead */
|
||||
|
||||
|
@ -157,7 +158,8 @@ lws_plat_service(struct libwebsocket_context *context, int timeout_ms)
|
|||
continue;
|
||||
|
||||
if (pfd->events & LWS_POLLOUT) {
|
||||
if (wsi_from_fd(context,pfd->fd)->sock_send_blocking)
|
||||
wsi = wsi_from_fd(context, pfd->fd);
|
||||
if (!wsi || wsi->sock_send_blocking)
|
||||
continue;
|
||||
pfd->revents = LWS_POLLOUT;
|
||||
n = libwebsocket_service_fd(context, pfd);
|
||||
|
|
Loading…
Add table
Reference in a new issue