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: Wed, 30 Nov 2011 17:11:30 -0500

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-11-30