cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl speed-limit problem

From: Nick Stone <nick.stone_at_snowvalley.com>
Date: Thu, 4 Mar 2010 13:51:49 -0000

I am using libcurl to get a load of statistics about sites we're
hosting. One of the things I have been trying to do is simulate a 2M
broadband connection by using the CURLOPT_MAX_SEND_SPEED_LARGE /
CURLOPT_MAX_RECV_SPEED_LARGE options. The code is pretty simple and is
as follows:

curl_off_t curlMaxBytesPerSecond;
curl_easy_setopt(mObjCurl, CURLOPT_MAX_SEND_SPEED_LARGE,
curlMaxBytesPerSecond);
curl_easy_setopt(mObjCurl, CURLOPT_MAX_RECV_SPEED_LARGE,
curlMaxBytesPerSecond);

When I compile and run the code it appears that the parameters are more
or less completely ignored. I did a search through the archives and
found this:

http://curl.haxx.se/mail/lib-2007-07/0273.html

I have tried setting the -D_FILE_OFFSET_BITS=64 flag during compile with
the result that it appears to now hang rather than limit the download if
the speed is set to a level below that which would naturally occur if
the parameters weren't set (e.g. if the normal download speed was 233000
bytes / second setting curlMaxBytesPerSecond to 300000 is fine whereas
setting 200000 causes libcurl to time out). I'm using libcurl 7.18.2 on
debian lenny. I have truned on verbose output and the connection is
being made OK and the download process is started but it doesn't
complete unfortunately. Can anyone shed some light on what the problem
might be?

Thanks

Nick

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