From c9ac31ee1c48ebb22349a077a4a6ac3298208f85 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 16 Feb 2013 10:17:52 +0800 Subject: [PATCH] handle any POLLIN before error See if this can impact http://libwebsockets.org/trac/ticket/16 Signed-off-by: Andy Green --- lib/libwebsockets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 3cdc6fa0..bf31d0a2 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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);