cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: help--why didn't CONNECTIONTIMEOUT work?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 3 Dec 2009 20:24:13 +0100 (CET)

On Wed, 2 Dec 2009, Basil Su wrote:

Uh, you top-posted so the context, order and threading get all weird now...

> (2) What protocol
> this problem occured when i tyr to do a ftp download ( url is
> ftp://68.xxx.xxx.xxx/file).

Aha, ftp. So what exactly happened during those 3 minutes you said it took?
There's this known flaw/bug which makes some of the first FTP
command/responses to not be considered part of the connection timeout-wise,
while I expect most users will think of it as such. But if the regular
CURLOPT_TIMEOUT didn't work either it shouldn't be that.

> (3) is it repeatable?
> every time
> (4) Does it always take that long against a particular site?
> yes

Can you use wireshark or CURLOPT_DEBUGFUNCTION or perhaps just CURLOPT_VERBOSE
and figure out what's taking all that time? Or can you help us reproduce this
failure in our end?

And it would be really nice if you could try the current CVS/daily snapshot
and see if this version too has this problem - I suspect it does but it would
be good to have it verified and then we could work on this problem from that.

> (5) What name resolver are you using
> i'm not sure i' have got it.

If you just built it as "default" you use the standard linux name resolving
functions. They should get aborted by the timeout still (as long as you didn't
ask to disable signals) so it's not really a reason for this problem, more
like good background info.

> and something wired:
> now i have 2 url.
> url1 can be download normally. and then i set (CONNECTTIMEOUT,5), and it
> turns out time-out very quickly which is reasonable.
> url2 is the one that always stay stuck for a long time. then i set
> (CURLOPT_CONNECTTIMEOUT,5) and it also stay stuck for the same time.
> and i stay stuck even i set (CURLOPT_TIMEOUT,5), and
> (CURLOPT_FTP_RESPONSE_TIMEOUT,5), it still didn't wokr.

And both URLs are for the same server? Does the second request re-use the same
connection as the first?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-03