cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Missing Timeout?

From: Yanick Pelletier <ypelletier_at_copernic.com>
Date: Fri, 19 Oct 2001 08:35:06 -0400

> I have a problem where i ask a server for an Header and it give me
> nothing, but the connection stay open, so the Transfer() function loop
> for ever!

Hm, yes. That is not actually an error condition! ;-)

> cURL posseed two Timeout option, one for the connection
> (CURLOPT_CONNECTTIMEOUT) and another for the total transfert time
> (CURLOPT_TIMEOUT). No one is usefull for me since i don't want to use
> CURLOPT_TIMEOUT since it can stop working transfert (the slow one).

Yeps.

> So does it is possible to have a Timeout that check the elapsed time
> between the receipt of data? This is in my opinion a better way to
> handle a timeout!

You mean like the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME
options?

I'd like to have a time limits between the reciept of two chuck of data.
Like setting a timeout of 60 seconds and if takes more than 60 seconds
between two reciept of two chuck of data, we quit with a time out... Maybe
CURLOPT_LOW_SPEED_TIMEOUT could be a correct name.

Currently i have modified the CURLOPT_TIMEOUT to do by changing line 867 by
this:

      if (data->set.timeout && (Curl_tvdiff (now, lastRecieptTime) >
data->set.timeout)) {

Where lasRecieptTime is initialized at the start of the function and i reset
its value to Curl_tvnow() when i recieve data.
Received on 2001-10-19