libmicrohttpd
[Top][All Lists]
Advanced

[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: Tue, 25 Apr 2017 19:36:14 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi Lorenzo,

Thanks for report!
We introduced more checks in release 0.9.53 to make MHD more foolproof.
Now MHD reject invalid combinations of flags instead of starting with
undefined behaviour.
Applications are advised to set explicitly flag
MHD_USE_INTERNAL_POLLING_THREAD when using MHD_USE_THREAD_PER_CONNECTION.
Currently MHD_USE_THREAD_PER_CONNECTION flag also enforce implicit
setting of MHD_USE_INTERNAL_POLLING_THREAD.
I fixed check to improve backward compatibility with
MHD_USE_THREAD_PER_CONNECTION and MHD_USE_POLL without
MHD_USE_INTERNAL_POLLING_THREAD.

If application will be used with new version of MHD, I strongly advise
to use MHD_USE_AUTO instead of MHD_USE_POLL or MHD_USE_EPOLL (unless you
have specific reason to use poll() or epoll). With MHD_USE_AUTO you will
get best performance on any platform.

If you know any rejected valid combination of flags - let me know. We'll
probably make a bugfix release soon.

-- 
Best Wishes,
Evgeny Grin

On 24.04.2017 16:38, Lorenzo Miniero wrote:
> Hi all,
> 
> I'm using MHD in my server and it works great. Recently I've been told,
> though, that some people couldn't get it to work. Somebody pointed out
> that it only seems to happen on recent versions, so I tried 0.9.53 (the
> latest on my Fedora) and that seems indeed to be the case.
> 
> Specifically, by fiddling a bit with the code it looks like the cause of
> the failure is the MHD_USE_POLL. Check this sample test code as an example:
> 
> https://gist.github.com/lminiero/5bd6795f2534b9c523c90603ec23816a
> 
> The code as it is results in a failure for me (daemon=NULL). If I remove
> the MHD_USE_POLL, it works instead. The same code was definitely working
> on the previous version of MHD my Fedora shipped (0.9.46), but not sure
> if 0.9.53 itself is the cause or any version in between.
> 
> At first I thought it could be a problem with flag names, as I read in
> the Changelog that some changed, but even in that case, the Changelog
> also says old names are still supported for backwards compatibilty.
> Besides, apparently MHD_USE_POLL is not one of the affected ones.
> 
> I also considered the possibility that it may be an issue with how the
> Fedora 25 rpm was built, as MHD_USE_POLL is supposed to fail if poll()
> is not available (#ifndef HAVE_POLL) and so it might simply be a matter
> of a broken check there, but I'm not convinced that's it, as the same
> issue was reported on different distros (e.g., Arch Linux) and systems
> (Mac OS). So if it really is a broken check, it seems to be broken in
> more than one place.
> 
> Do you have any insight on what may be the problem here?
> 
> Thanks!
> Lorenzo

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]