cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Bug in the multi interface? (curl_multi_wait returns 0)

From: Clemens Gruber <clemens.gruber_at_pqgruber.com>
Date: Tue, 19 Feb 2013 14:39:44 +0100

Just wanted to add that I did not build the two example versions for
7.28.1 and 7.29.0 with different resolver backends. In both cases, I
used the threaded resolver, so it must have been caused by different
code paths, as you suggested.

The docs however suggest, that the function won't return until either
the timeout passed or a file descriptor is ready, but not that it will
behave differently for the c-ares and the threaded resolver.

Maybe another line in the docs for curl_multi_wait would be useful for
newcomers.

> Hi,
>
> I removed the check for !numfds and now it works perfectly for both
> versions, with c-ares and the threaded resolver. Calling
> curl_multi_perform if numfds is 0 seems not to be a problem.
> Anyway, c-ares is a little bit faster in my case, so I'll stick with that.
>
> Thank you very much for your assistance!
>
> Clemens
>
>
>> This is due to a faulty assumption on your behalf, possibly induced by not
>> having this explained properly in the man page.
>>
>> The difference you see between the two versions is probably there because you
>> have built them with different resolver backends - or just that the code paths
>> are a little bit different between the versions.
>>
>> The thing is that curl_multi_wait() can very well return zero 'numfds' without
>> that being a problem - that's also why it returns OK for that situation. In
>> some cases libcurl simply doesn't have any file descriptors to wait on and
>> then it can't return any with activity.
>>
>> I can repeat this scenario with using the threaded resolver but it does not
>> happen when I build with c-ares instead.
>>
>> -- / daniel.haxx.se
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-19