The function resume_suspended_connections() is just being called from
the internal "mainloops" select()/poll(). If the user is using its
own mainloop and calling manually MHD_run_from_select() a suspended
connection is never resumed.
This patch takes in consideration if it's being used an extern mainloop
to avoid call MHD_run_from_select() twice.
Please guys i'm not sure if this is the best way to send a patch. Should
i fill a bug at the bugtracker ? The patch should be attached or inline
is good enough ?
Thanks in advance,
--
Flavio Ceolin
Intel Open source Technology Center
Index: src/microhttpd/daemon.c
===================================================================
--- src/microhttpd/daemon.c (revision 36289)
+++ src/microhttpd/daemon.c (working copy)
@@ -2220,7 +2220,13 @@
char tmp;
struct MHD_Connection *pos;
struct MHD_Connection *next;
+ unsigned int mask = MHD_USE_SUSPEND_RESUME |
MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY |
+ MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL_INTERNALLY |
MHD_USE_THREAD_PER_CONNECTION;
+ /* Resuming external connections when using an extern mainloop */
+ if (MHD_USE_SUSPEND_RESUME == (daemon->options & mask))
+ resume_suspended_connections(daemon);
+
#if EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{