curl-library
How to limit rate with libcurl?
From: Jick Nan <jick.nan_at_gmail.com>
Date: Thu, 7 Dec 2006 09:40:24 +0000
Received on 2006-12-07
Date: Thu, 7 Dec 2006 09:40:24 +0000
Hello,
I want to limit rate with libcurl's new method, but I can't let it
working correctly.
I set the following options for this:
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
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);
but it's failed to limit the speed. Please see the attachment (curl.c)
for detail.
Any one can give me some comments on correctly using
MAX_SEND_SPEED_LARGE option?
Thanks!
Jick
-- "生活就是个缓慢受锤的过程,人一天天老下去,奢望也一天天消失,最后变得像挨了锤的牛一样。"
- application/octet-stream attachment: curl