[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] 0.9.53 breaks MHD_USE_POLL?
From: |
Evgeny Grin |
Subject: |
Re: [libmicrohttpd] 0.9.53 breaks MHD_USE_POLL? |
Date: |
Wed, 26 Apr 2017 14:39:49 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
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
> 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.
>
It better to specify MHD_USE_SELECT_INTERNALLY explicitly.
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".
--
Best Wishes,
Evgeny Grin