View Issue Details

IDProjectCategoryView StatusLast Update
0003179libmicrohttpdexternal APIpublic2013-12-24 22:28
Reportermatt.holiday Assigned ToChristian Grothoff Due Date
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 20:43

manager   ~0007806

Fixed in SVN 31241 as suggested.

Issue History

Date ModifiedUsernameFieldChange
2013-12-09 20:37matt.holidayNew Issue
2013-12-09 20:37matt.holidayFile Added: bug.diff
2013-12-09 20:43Christian GrothoffNote Added: 0007806
2013-12-09 20:43Christian GrothoffStatusnew => resolved
2013-12-09 20:43Christian GrothoffFixed in Version => 0.9.33
2013-12-09 20:43Christian GrothoffResolutionopen => fixed
2013-12-09 20:43Christian GrothoffAssigned To => Christian Grothoff
2013-12-09 20:43Christian GrothoffTarget Version => 0.9.33
2013-12-24 22:28Christian GrothoffStatusresolved => closed
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API