cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to limit rate with libcurl?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 7 Dec 2006 23:30:53 -0800

On Fri, Dec 08, 2006 at 07:07:45AM +0000, Jick Nan wrote:
> Nothing effected.
>
> My test code is the same as the last time I used. I just update the
> libcurl.
>
> Sorry, I attached a wrong file last time, this is the real curl.c.

> curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, MAX_RATE);
> curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, MAX_RATE);
> curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, MAX_RATE);

You aren't passing the right type for any of these options. The buffer size
must be a long, and the two speed types must be curl_off_t. And are you
sure you want the buffer size to be the same number as the transfer rate?
The number you give is much larger than CURL_MAX_WRITE_SIZE and "it only
makes sense to use this option if you want it smaller."

>>> Dan
Received on 2006-12-08