cURL / Mailing Lists / curl-users / Single Mail

curl-users

FTP upload status bar patch

From: Alex Suykov <sscart_at_ukr.net>
Date: Wed, 20 Apr 2005 04:52:53 +0300

I made a quick patch to make cURL show status bar during
FTP uploads. It seems like it was a reported bug:
http://curl.haxx.se/mail/lib-2004-05/0158.html
Hope it will be useful for someone but me.

diff -Nurb curl-cvs-2005.04.17.orig/src/main.c curl-cvs-2005.04.17/src/main.c
--- curl-cvs-2005.04.17.orig/src/main.c 2005-03-29 01:17:49.000000000 +0300
+++ curl-cvs-2005.04.17/src/main.c 2005-04-18 08:32:40.000000000 +0300
@@ -3396,9 +3396,11 @@
         if(uploadfile && config->resume_from_current)
           config->resume_from = -1; /* -1 will then force get-it-yourself */
 
- if(outs.stream && isatty(fileno(outs.stream)))
+ if(!uploadfile && outs.stream && isatty(fileno(outs.stream)))
           /* we send the output to a tty, therefore we switch off the progress
              meter */
+ /* when uploading, outs.stream is a tty but nothing is going to be
+ sent there */
           config->conf |= CONF_NOPROGRESS;
 
         if (urlnum > 1 && !(config->conf&CONF_MUTE)) {
Received on 2005-04-20