cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: timeouts and multithreading

From: Lucas Adamski <wakked1_at_yahoo.com>
Date: Thu, 20 Sep 2001 13:39:48 -0700

Daniel,

Fortunately I came across an iffy but effective hack in the mean time.
Solaris (at least) allows you to change tcp connection timeouts by using
"ndd -set /dev/ip tcp_ip_abort_cinterval=<timeout in half milliseconds>".
For example,
ndd -set /dev/ip tcp_ip_abort_cinterval=15000
.. results in an total CURL connection timeout of about 24 seconds (include
NS lookup, etc). It'll serve my purpose for the time being! Thanks,
  Lucas.

-----Original Message-----
From: curl-library-admin_at_lists.sourceforge.net
[mailto:curl-library-admin_at_lists.sourceforge.net]On Behalf Of Daniel
Stenberg
Sent: Thursday, September 20, 2001 12:41 AM
To: Libcurl
Subject: Re: timeouts and multithreading

On Wed, 19 Sep 2001, Lucas Adamski wrote:

> I've made decent progress on my little C++ libcurl project, however I
> haven't had much luck figuring out a way to get timeouts to work. I was
> going to try taking the tact of killing threads that exceed a certain
> time limit, but apparently that's considered a Bad Idea.

In general, yes.

> I wouldn't mind changing the connect timeouts in the Solaris source code,
> however I don't have access to a sun compiler to rebuild. Even then it
> wouldn't solve other potential problems such as hung sockets, etc. Has
> anyone gotten over this problem yet?

The timeouts are only signal-based for operations that are truely slow and
synchronous (and happen before any actual transfer takes place). In a
"normal" operation, that is the name resolving and socket connect call.

Once the connect is passed, no signals are used to deal with the timeout.
Only select().

The connection should be rewritten to use non-blocking connect to avoid the
need for signals.

The name resolving could be rewritten using an asynchronous name resolver
that would be possible to abort without signals. This would take some
effort
to make it work neatly on many platforms.

--
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-20