cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH 1/2] hiperfifo: Rate limit download and print time stamp in order to repro problem with CURLOPT_MAX_RECV_SPEED_LARGE.

From: none <njm_at_lith.(none)>
Date: Sun, 30 Jan 2011 10:09:35 -0800

---
 docs/examples/hiperfifo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index a885c0c..42fc824 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -285,7 +285,7 @@ static int prog_cb (void *p, double dltotal, double dlnow, double ult,
   (void)ult;
   (void)uln;
 
-  fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
+  fprintf(MSG_OUT, "%d Progress: %s (%g/%g)\n", (int)time(NULL), conn->url, dlnow, dltotal);
   return 0;
 }
 
@@ -316,6 +316,8 @@ static void new_conn(char *url, GlobalInfo *g )
   curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L);
   curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
   curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
+  curl_easy_setopt(conn->easy, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)50000);
+  curl_easy_setopt(conn->easy, CURLOPT_BUFFERSIZE, (curl_off_t)50000);
   fprintf(MSG_OUT,
           "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
   rc = curl_multi_add_handle(g->multi, conn->easy);
-- 
1.7.1
--------------030800090909050706050103
Content-Type: text/x-patch;
 name="multi_toofast_update_progress.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="multi_toofast_update_progress.patch"
Received on 2001-09-17