handle any POLLIN before error 11/3111/1
authorAndy Green <andy.green@linaro.org>
Sat, 16 Feb 2013 02:17:52 +0000 (10:17 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:36 +0000 (13:01 -0800)
See if this can impact http://libwebsockets.org/trac/ticket/16

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c

index 3cdc6fa..bf31d0a 100644 (file)
@@ -932,7 +932,8 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
 
                /* handle session socket closed */
 
-               if (pollfd->revents & (POLLERR | POLLHUP)) {
+               if ((!pollfd->revents & POLLIN) &&
+                               (pollfd->revents & (POLLERR | POLLHUP))) {
 
                        lwsl_debug("Session Socket %p (fd=%d) dead\n",
                                (void *)wsi, pollfd->fd);