View Issue Details

IDProjectCategoryView StatusLast Update
0006036libmicrohttpdlibmicrohttpd APIpublic2020-02-08 22:03
ReportermedocAssigned ToChristian Grothoff 
Status closedResolutionfixed 
Product Versioncurrent SVN 
Target Version0.9.70Fixed in Version0.9.70 
Summary0006036: MHD_USE_NO_LISTEN_SOCKET | MHD_USE_THREAD_PER_CONNECTION always overflows the connection count
DescriptionWhen starting the daemon with the above flags (and MHD_USE_SELECT_INTERNALLY/MHD_USE_INTERNAL_POLLING_THREAD), then using add_connection() to process incoming connections, the connection count always ends up overflowing, and add_connection() fails with "Server reached connection limit (closing inbound connection)", or an out of descriptors error, depending on the configuration and version.

As far as I can see, the reason is that nobody in this configuration actually calls MHD_cleanup_connections() (MHD_polling_thread is not running because of NO_LISTEN_SOCKET).

With microhttpd 0.9.51, this can be worked around by calling MHD_get_daemon_info(daemon MHD_DAEMON_INFO_CURRENT_CONNECTIONS), which apparently triggers a cleanup.

With 0.9.59 and current git code, I found no workaround, it always ends up in overflow.
Steps To ReproduceAttaching a sample program, just loop wget on it.
TagsNo tags attached.



2020-01-07 20:08


trmhttp.c (4,403 bytes)

Christian Grothoff

2020-02-07 14:28

manager   ~0015314

Fixed in 94e8d665..6da31a1c by adding a call to MHD_cleanup_connections() inside MHD_add_connection().
Thanks for reporting!

Issue History

Date Modified Username Field Change
2020-01-07 20:08 medoc New Issue
2020-01-07 20:08 medoc File Added: trmhttp.c
2020-02-07 14:16 Christian Grothoff Assigned To => Christian Grothoff
2020-02-07 14:16 Christian Grothoff Status new => assigned
2020-02-07 14:24 Christian Grothoff Product Version => current SVN
2020-02-07 14:24 Christian Grothoff Target Version => 0.9.70
2020-02-07 14:28 Christian Grothoff Note Added: 0015314
2020-02-07 14:28 Christian Grothoff Status assigned => resolved
2020-02-07 14:28 Christian Grothoff Resolution open => fixed
2020-02-07 14:28 Christian Grothoff Fixed in Version => 0.9.70
2020-02-08 22:03 Christian Grothoff Status resolved => closed