cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POSIX threaded DNS resolver - first experiences

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Thu, 22 Apr 2010 20:20:33 +0200

On Thursday 22 of April 2010 19:29:20 Constantine Sapuntzakis wrote:
> The problem is with the test.

I bet you're right. I am a bit new to the multi interface. I hope that
libcurl based applications do not have the same flaw as test536 then :-)

> test536 doesn't handle maxfd == -1, which is a valid response from
> curl_multi_fdset when using the threaded resolver.
>
> I did a quick test on Mac OS X and changed the code to do the following:
>
> if (maxfd < 0) {
> sleep(1);
> continue;
> }

What about the attached patch?

> Unfortunately, this code won't compile on Windows (no sleep call).

Now it should compile fine on both systems and it seems like the fix is not
needed on Windows because of the following quirk:

http://github.com/bagder/curl/blob/master/lib/hostthre.c#L313

> BTW, ares has better abort semantics than the threaded resolver.
> curl_*_cleanup will hang in the threaded DNS resolver until the
> resolver thread exits.

Good point. I didn't test it so far.

Kamil

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2010-04-22