cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_TIMEOUT and CURLOPT_LOW_SPEED_TIME question

From: Dragos MOINESCU <dmoinescu_at_bitdefender.com>
Date: Wed, 7 Nov 2007 16:25:46 +0200

When downloading files (small and large) I need libcurl to close connection
and return some error code each time the transfer is stalled (no bytes
coming from peer).
The problem is that setting CURLOPT_LOW_SPEED_TIME means that I cannot allow
extremely low downloaders to grab a file. I need to download even with 1
byte / 29 seconds.
I know this scenario is kind of weird, but I really have to do this.

At the moment I am using CURLOPT_TIMEOUT that limits the size of the file to
download. The problem is that I cannot set a large value to allow a bigger
size to download. Yet I need to return an error code whenever connection is
stalled.

Also, is there any method to curl_easy_cleanup() during connect()? Lets say
you use CURLOPT_CONNECTTIMEOUT to set 30 seconds time to connect() and in
the same time you receive a signal to terminate the process. I would like to
have a nice method of exiting from curl_easy_perform() in the middle of
connecting process.

Thanx for your time.

Dragos MOINESCU,
Head of Web Development Team
+4 0729 880 972
http://www.bitdefender.com
Received on 2007-11-07