Hi folks,

I guess i found a problem with suspended connections. There is a
scenarion where one can resume a connection and then stop the daemon
without gives the daemon the oportunity to really resume the connection.
In this case, microhttpd will abort telling one that there is suspended
connection (because the connection is still in the daemon's suspended
list).

The following patch solves the problem (i've this problem using external
mainloop).

Regards,
Flavio Ceolin

Index: src/microhttpd/daemon.c
===================================================================
--- src/microhttpd/daemon.c     (revision 36651)
+++ src/microhttpd/daemon.c     (working copy)
@@ -4489,6 +4489,9 @@
 
   if (NULL == daemon)
     return;
+  if (MHD_USE_SUSPEND_RESUME & daemon->options)
+    resume_suspended_connections (daemon);
+
   daemon->shutdown = MHD_YES;
   fd = daemon->socket_fd;
   daemon->socket_fd = MHD_INVALID_SOCKET;

Reply via email to