View Issue Details

IDProjectCategoryView StatusLast Update
0003179libmicrohttpdexternal APIpublic2013-12-24 23:28
Reportermatt.holiday Assigned ToChristian Grothoff  
PriorityurgentSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.32 
Target Version0.9.33Fixed in Version0.9.33 
Summary0003179: With suspend/resume enabled, per-worker daemon pipes not closed
DescriptionPer-worker daemon pipes enabled with MHD_USE_SUSPEND_RESUME aren't closed in MHD_stop_daemon
Steps To ReproduceStart & stop lots of daemons in one process; fds leak
TagsNo tags attached.
Attached Files
bug.diff (782 bytes)   
Index: src/microhttpd/daemon.c
===================================================================
--- src/microhttpd/daemon.c	(revision 31239)
+++ src/microhttpd/daemon.c	(working copy)
@@ -3978,6 +3978,16 @@
 	       (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) )
 	    MHD_PANIC ("close failed\n");
 #endif
+          if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) )
+            {
+              if (-1 != daemon->worker_pool[i].wpipe[1])
+                {
+	           if (0 != CLOSE (daemon->worker_pool[i].wpipe[0]))
+	             MHD_PANIC ("close failed\n");
+	           if (0 != CLOSE (daemon->worker_pool[i].wpipe[1]))
+	             MHD_PANIC ("close failed\n");
+                }
+	    }
 	}
       free (daemon->worker_pool);
     }
bug.diff (782 bytes)   

Activities

Christian Grothoff

2013-12-09 21:43

manager   ~0007806

Fixed in SVN 31241 as suggested.

Issue History

Date Modified Username Field Change
2013-12-09 21:37 matt.holiday New Issue
2013-12-09 21:37 matt.holiday File Added: bug.diff
2013-12-09 21:43 Christian Grothoff Note Added: 0007806
2013-12-09 21:43 Christian Grothoff Status new => resolved
2013-12-09 21:43 Christian Grothoff Fixed in Version => 0.9.33
2013-12-09 21:43 Christian Grothoff Resolution open => fixed
2013-12-09 21:43 Christian Grothoff Assigned To => Christian Grothoff
2013-12-09 21:43 Christian Grothoff Target Version => 0.9.33
2013-12-24 23:28 Christian Grothoff Status resolved => closed
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API