diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-04-23 21:26:27 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-04-23 21:26:27 +0000 |
commit | 1a4402038c0d148b1260fd5b8e2eddbdc7fce38e (patch) | |
tree | 421be8037f05cb360ec29588c801c12cc8532c6c /src | |
parent | 5ac51cc9b5a5fbaa9eb111197334fe1e1f938018 (diff) |
Alex Suykov's ftp upload show progress meter patch, slightly adjusted.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 298456dc6..f96dd8b57 100644 --- a/src/main.c +++ b/src/main.c @@ -2900,6 +2900,17 @@ static void FindWin32CACert(struct Configurable *config, #define RETRY_SLEEP_DEFAULT 1000 /* ms */ #define RETRY_SLEEP_MAX 600000 /* ms == 10 minutes */ +static bool +output_expected(char* url, char* uploadfile) +{ + if(!uploadfile) + return TRUE; /* download */ + if(checkprefix("http://", url) || checkprefix("https://", url)) + return TRUE; /* HTTP(S) upload */ + + return FALSE; /* non-HTTP upload, probably no output should be expected */ +} + static int operate(struct Configurable *config, int argc, char *argv[]) { @@ -3399,7 +3410,8 @@ operate(struct Configurable *config, int argc, char *argv[]) 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(output_expected(url, uploadfile) + && outs.stream && isatty(fileno(outs.stream))) /* we send the output to a tty, therefore we switch off the progress meter */ config->conf |= CONF_NOPROGRESS; |