cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: error (6) : name lookup timed out

From: sundararaj reel <sundararaj.reel_at_googlemail.com>
Date: Thu, 4 Dec 2008 12:56:52 +0100

On Thu, Dec 4, 2008 at 12:32 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 4 Dec 2008, sundararaj reel wrote:
>
> Here is a small example to show the behaviour.
>> Code : http://codepad.org/eC6CNr17
>> Output: http://codepad.org/F5lJPXHV
>>
>> How can libcurl reach the server when connection has been restablished,
>> without restarting the program ?
>>
>
> What libcurl version on what platform is this?
>

 libcurl 7.16.4 on Ubuntu 2.6.22-14-generic

> What name resolver does it use?

 If it is the contents of /etc/resolv.conf you ask, then:

$cat /etc/resolv.conf
search local
nameserver 195.50.140.252
nameserver 195.50.140.114

>
> I figure using strace or similar could be useful to detect what system call
> that fail in the problematic case.
>

I donot know how to use strace. But here is a snippet that I get when
running strace ./a.out if this helps.
It waits at the second poll() for about 5 seconds when internet connection
is down :
....
poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(5, "\366m\1\0\0\1\0\0\0\0\0\0\7example\3com\0\0\1\0\1", 29,
MSG_NOSIGNAL) = 29
poll([{fd=5, events=POLLIN}], 1, 5000) = -1 EINTR (Interrupted system call)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGALRM, {SIG_DFL}, NULL, 8) = 0
alarm(0) = 0
write(1, "(curl_test.c:43) Downloading htt"..., 71(curl_test.c:43)
Downloading http://example.com ... FAILED
) = 71
...

-- 
Sundararaj
Received on 2008-12-04