cURL / Mailing Lists / curl-library / Single Mail

curl-library

built-in progress meter problem

From: Dmitri Shubin <sbn_at_tbricks.com>
Date: Mon, 13 Dec 2010 19:25:21 +0300

Hello all!

I have a problem with built-in progress meter -- the last progress
update is printed on separate line:

$ ./a.out >/dev/null
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 15204 0 0 0 0 0 0 --:--:-- 0:01:05
--:--:-- 0
100 15204 100 15204 0 0 229 0 0:01:06 0:01:06
--:--:-- 4027$

I use modified version of docs/examples/multi-single.c example from
libcurl 7.21.2 distribution for testing.
Here is diff:
--- ../../../../curl-7.21.2/docs/examples/multi-single.c
2010-10-11 01:22:27.000000000 +0400
+++ multi-single.c 2010-12-13 19:08:49.548792506 +0300
@@ -32,7 +32,8 @@
   http_handle = curl_easy_init();
 
   /* set the options (I left out a few, you'll get the point anyway) */
- curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
+ curl_easy_setopt(http_handle, CURLOPT_URL,
"ftp://ftp.kernel.org/bin/compress");
+ curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
 
   /* init a multi stack */
   multi_handle = curl_multi_init();

AFAIU from libcurl sources this is due to Curl_pgrsUpdate() from
lib/progress.c is called after Curl_posttransfer() (lib/transfer.c)
which prints the newline character.

Thanks!
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-13