|
From: | Lorenzo Miniero |
Subject: | Re: [libmicrohttpd] 0.9.53 breaks MHD_USE_POLL? |
Date: | Wed, 26 Apr 2017 13:59:23 +0200 |
On 26.04.2017 13:54, Lorenzo Miniero wrote:
> Thanks! So, just to clarify, when doing MHD_USE_THREAD_PER_CONNECTION,
> even with MHD_USE_AUTO you still need to specify
> MHD_USE_SELECT_INTERNALLY (or the newer
> MHD_USE_INTERNAL_POLLING_THREAD), or does MHD_USE_AUTO also It better to specify MHD_USE_SELECT_INTERNALLY explicitly.
> automatically sets the correct threading model? Asking because the way
> I was addressing this in a pull request on my project was simply to do a:
>
> #if MHD_VERSION >= 0x00095208
> MHD_USE_THREAD_PER_CONNECTION | MHD_USE_AUTO | MHD_USE_DUAL_STACK,
> #else
> MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL | MHD_USE_DUAL_STACK,
> #endif
>
> which seems to be working as expected on 0.9.53.
>
If it is not specified, MHD_USE_THREAD_PER_CONNECTION will use
MHD_USE_SELECT_INTERNALLY implicitly.
Version 0.9.53 fails with poll and without MHD_USE_SELECT_INTERNALLY
because check of invalid combinations of flags is done *before* adding
automatically MHD_USE_SELECT_INTERNALLY.
It was fixed in git master.
I recommend you to always use MHD_USE_SELECT_INTERNALLY when you specify
MHD_USE_THREAD_PER_CONNECTION.
Or use predefined combination of flags:
#if MHD_VERSION >= 0x00095208
MHD_USE_THREAD_PER_CONNECTION | MHD_USE_AUTO_INTERNAL_THREAD |
MHD_USE_DUAL_STACK,
#else
MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL_INTERNALLY |
MHD_USE_DUAL_STACK,
#endif
I also recommend to use MHD_USE_DEBUG flag when you developing
something. Actually, it is not a "debug", it is a "log".
[Prev in Thread] | Current Thread | [Next in Thread] |