My question for the group is: might this be due to a bug in libmicrohttpd? Has anyone seen similar problems? I would expect the connection timeout I'm setting to prevent this problem from lasting, at least. Perhaps this suggests that the problem is in my web callback, and that libmicrohttpd never gets a chance to detect the problem and clean up after it?
The error I'm seeing is:
Server reached connection limit (closing inbound connection)
I have configured the web daemon like so:
MHD_start_daemon( MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG
, &webClientAuthCallback, this
, MHD_OPTION_CONNECTION_LIMIT, 20
, MHD_OPTION_PER_IP_CONNECTION_LIMIT, 20
, MHD_OPTION_CONNECTION_TIMEOUT, 630
, MHD_OPTION_URI_LOG_CALLBACK, uriLogCallback, this
, MHD_OPTION_EXTERNAL_LOGGER, webErrorCallback, this
The webCallback() method authenticates, carries out the requested task, and then ends with this code:
struct MHD_Response * mhdResponse;
if( !( mhdResponse = MHD_create_response_from_data( pageContent.length()
, const_cast<void*>( reinterpret_cast<const void*>( pageContent.c_str() ) ), MHD_YES, MHD_YES ) ) ) {
for( map<string, string>::const_iterator it = headers.begin(); it != headers.end(); ++it ) {
if( MHD_add_response_header( mhdResponse, it->first.c_str(), it->second.c_str() ) == MHD_NO ) {
// Enqueue and destroy the response
int result = MHD_queue_response( connection, mhdResponseCode, mhdResponse );
MHD_destroy_response( mhdResponse );
Thanks for your time,
Jesse