multi: handle timeouts on DNS servers by checking for new sockets
authorJason Glasgow <jglasgow@chromium.org>
Wed, 30 Nov 2011 20:23:44 +0000 (15:23 -0500)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 2 Dec 2011 09:18:52 +0000 (10:18 +0100)
commitadc88ca203bbb602cc9a1726669526fa7b3723ef
treeee204bc5025ed66554ca1cfbbea4637ec64cf14a
parent83350c9cc407d8292e9576991f23415c6ad1a021
multi: handle timeouts on DNS servers by checking for new sockets

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.  Ensure that the list of sockets are always updated after
calling Curl_resolver_is_resolved.

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.  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.
lib/asyn-ares.c
lib/multi.c