commit 2a1c84ac2687ea9d743dae66fb9fda5cc99f368e
parent 74d383c58105026f05856f38d7f4555bcdfb701c
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 7 Sep 2016 11:17:32 +0000
applying Hawk's fix for #4641
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,6 @@
+Wed Sep 7 12:57:57 CEST 2016
+ Fixing #4641. -Hawk
+
Wed Sep 7 00:28:59 CEST 2016
Adding remaining "_"-markups for i18n (#4614). -CG
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -3187,12 +3187,14 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
int timeout;
unsigned int poll_count;
int poll_listen;
+ int poll_pipe;
memset (&p,
0,
sizeof (p));
poll_count = 0;
poll_listen = -1;
+ poll_pipe = -1;
if (MHD_INVALID_SOCKET != daemon->socket_fd)
{
p[poll_count].fd = daemon->socket_fd;
@@ -3206,6 +3208,7 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
p[poll_count].fd = daemon->wpipe[0];
p[poll_count].events = POLLIN;
p[poll_count].revents = 0;
+ poll_pipe = poll_count;
poll_count++;
}
if (MHD_NO == may_block)
@@ -3229,6 +3232,10 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
#endif
return MHD_NO;
}
+ if ( (-1 != poll_pipe) &&
+ (0 != (p[poll_pipe].revents & POLLIN)) )
+ MHD_pipe_drain_ (daemon->wpipe[0]);
+
/* handle shutdown */
if (MHD_YES == daemon->shutdown)
return MHD_NO;