cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wrong behavior when activate the LOW_SPEED_LIMIT and LOW_SPEED_TIME

From: Jie He <jie.he.cn_at_gmail.com>
Date: Thu, 20 Sep 2012 10:58:34 +0800

set option CURLOPT_MAX_RECV_SPEED_LARGE to 1024L
set option CURLOPT_LOW_SPEED_LIMIT 1L
set option CURLOPT_LOW_SPEED_TIME n mins

MUST limit the receive rate to 1k first.
the behavior occurs only when the receive rate is very low.
during 5 seconds, the members of speeder array have same value.

2012/9/20 Daniel Stenberg <daniel_at_haxx.se>

> On Thu, 13 Sep 2012, Jie He wrote:
>
> e.g. if I set the LOW_SPEED_TIME to n mins, the time-out will be
>> triggered in n mins, in the same time, the network is OK. it seems the
>> LOW_SPEED_TIME algorithm has some problems.
>>
>
> Thanks for the report, but I fail to repeat your issue. This is the code
> I've used, which downloads a 4.2GB file from localhost at roughly 100MB/sec:
>
> #include <stdio.h>
> #include <curl/curl.h>
>
> int main(void)
> {
> CURL *curl;
> CURLcode res;
>
> curl = curl_easy_init();
> if(curl) {
> curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/big/4200big"**);
> curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024L);
> curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, (long)15);
> curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
>
> /* Perform the request, res will get the return code */
> res = curl_easy_perform(curl);
> /* Check for errors */
> if(res != CURLE_OK)
> fprintf(stderr, "curl_easy_perform() failed: %s\n",
> curl_easy_strerror(res));
>
> /* always cleanup */
> curl_easy_cleanup(curl);
> }
> return 0;
> }
>
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-- 
Best Regards
He Jie ºÎ½Ü

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-20