cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: problems with --connect-timeout and --max-time options

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 12 Oct 2001 10:06:24 +0200 (MET DST)

On Thu, 11 Oct 2001 josh.m.daynard_at_accenture.com wrote:

> I'm using cURL 7.8.1 and I'm not having much luck getting the connect
> timeout and maxtime options working. Occasionally, the server that I'm
> trying to connect to goes down completely and doesn't respond at all to
> requests. In this case, I would like cURL to exit gracefully after 30
> seconds max and then I can handle the fact that I received no data back.
> However, neither of these options seem to work:
>
> -m 30 and/or --connect-timeout 30
>
> When using either or both of these options when the server is down, curl
> still hangs for like 6 minutes to infinity ... Am I using these options
> incorrectly? How can I always ensure that my curl call returns no matter
> what after 30 seconds max?

What operating system are you using? Are you possibly using somd kind of
Windows? If so, that is the reason: we don't have any way to gracefully
cancel slow function calls in windows, so if the name resolving takes a long
time there's nothing we can do about it.

(Any fixes that can improve this situation are welcome.)

Unix versions should get the timeout pretty accurately, as the functions will
be aborted forcibly with a SIGALRM.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-12