I am using libmicrohttpd in a multithreaded application in the
thread-per-connection mode. In order to maintain statistics and such on
the various clients, the application should be notified about
connections being started and stopped. Something like the
MHD_OPTION_NOTIFY_COMPLETED for requests, but then for connections. As
far as I could find libmicrohttpd does not (yet) provide that functionality.
Attached is a patch that does add this functionality by registering a
connection notification callback function: MHD_OPTION_NOTIFY_CONNECTION
(inspired by the MHD_OPTION_NOTIFY_COMPLETED option).
Could this be included in libmicrohttpd?
=>
The patch was only working for multithreaded apps, so I adjusted it
to cover other threading models, fixed a merge issue and added the
ability to associate a void* with the callbacks (and obtain it via
MHD connection info). And I updated the manual & ChangeLog. Now
I think it can be included ;-).
Problem using MHD_OPTION_HTTPS_MEM_DHPARAMS in MHD_OPTION_ARRAY
From:
Denis Dowling <Denis.Dowling@hsd.com.au>
Date:
02/26/2015 01:52 AM
To:
"libmicrohttpd@gnu.org" <libmicrohttpd@gnu.org>
Hi,
I was trying to add a Diffie Hellman key to the libmicrohttpd server using the MHD_OPTION_HTTPS_MEM_DHPARAMS option. I was putting this option into a vector and then passing this to MHD_start_daemon using the MHD_OPTION_ARRAY argument. This was failing and I tracked the problem down to a missing option in the switch statement in parse_options_va().
diff --git a/external/libmicrohttpd-0.9.39/src/microhttpd/daemon.c b/external/li
index 0816a4a..ce76a3b 100644
--- a/external/libmicrohttpd-0.9.39/src/microhttpd/daemon.c
+++ b/external/libmicrohttpd-0.9.39/src/microhttpd/daemon.c
@@ -3178,6 +3178,7 @@ parse_options_va (struct MHD_Daemon *daemon,
case MHD_OPTION_HTTPS_MEM_KEY:
case MHD_OPTION_HTTPS_MEM_CERT:
case MHD_OPTION_HTTPS_MEM_TRUST:
+ case MHD_OPTION_HTTPS_MEM_DHPARAMS:
case MHD_OPTION_HTTPS_PRIORITIES:
case MHD_OPTION_ARRAY:
case MHD_OPTION_HTTPS_CERT_CALLBACK:
Regards,
Denis