cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PATCH: Handle DNS timeouts on multi-interfaces better

From: Jason Glasgow <jglasgow_at_google.com>
Date: Thu, 1 Dec 2011 07:24:52 -0500

Attached is an updated patch that deals with the fact that if the c-ares
timeout is less than 1000us it gets rounded to zero, which when Curl_expire
is called removes *all* timeouts.
-Jason

On Wed, Nov 30, 2011 at 5:11 PM, Jason Glasgow <jglasgow_at_google.com> wrote:

> Please hold off on evaluating this patch. I've been doing some more
> testing and I am not sure it is right. -Jason
>
>
> On Wed, Nov 30, 2011 at 3:43 PM, Jason Glasgow <jglasgow_at_google.com>wrote:
>
>> Attached is a patch to fix a problem I've been having with the
>> multi-interface. The problem that I've observed is that if the first name
>> server is not available, the multi interface does not invoke the socket_cb
>> when the DNS request to the first name server timesout.
>>
>> This bug can be reproduced if Curl is complied with --enable_ares
>> and your code uses the multi socket interfaces and
>> the CURLMOPT_SOCKETFUNCTION option. The way I test is to set up an
>> iptables rule that discards the name server reply from the first name
>> server. This forces a timeout and then cares tries to use the secondary
>> name server. Without the patch, the client code is never informed of the
>> new socket that cares is using.
>>
>> To test try:
>> iptables -I INPUT \
>> -s $(sed -n -e '/name/{s/.* //p;q}' /etc/resolv.conf)/32 \
>> -j REJECT
>> and then run a program which uses the multi-interface
>>
>> -Jason
>>
>>
>

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

Received on 2011-12-01