cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wrong behavior when activate the LOW_SPEED_LIMIT and LOW_SPEED_TIME

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Sep 2012 22:55:38 +0200 (CEST)

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
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-19