From: Patrick Gansterer Date: Sun, 30 Mar 2014 07:54:55 +0000 (+0200) Subject: Windows: Support LWS_POLLHUP socket event X-Git-Tag: upstream/1.7.3~684 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3e8337bbd2ce4672530f691ecfd6012bec79519;p=platform%2Fupstream%2Flibwebsockets.git Windows: Support LWS_POLLHUP socket event --- diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 9fce893..8f88885 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1555,12 +1555,10 @@ libwebsocket_service(struct libwebsocket_context *context, int timeout_ms) return -1; } - pfd->revents = (networkevents.lNetworkEvents & LWS_POLLIN) ? LWS_POLLIN : 0; + pfd->revents = networkevents.lNetworkEvents; - if (networkevents.lNetworkEvents & LWS_POLLOUT) { + if (pfd->revents & LWS_POLLOUT) context->lws_lookup[pfd->fd]->sock_send_blocking = FALSE; - pfd->revents |= LWS_POLLOUT; - } return libwebsocket_service_fd(context, pfd); #else @@ -1735,7 +1733,7 @@ lws_change_pollfd(struct libwebsocket *wsi, int _and, int _or) struct libwebsocket_pollfd *pfd; struct libwebsocket_pollargs pa; #ifdef _WIN32 - long networkevents = FD_WRITE; + long networkevents = LWS_POLLOUT | LWS_POLLHUP; #endif pfd = &context->fds[wsi->position_in_fds_table];