mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Alex Suykov's ftp upload show progress meter patch, slightly adjusted.
This commit is contained in:
parent
5ac51cc9b5
commit
1a4402038c
14
src/main.c
14
src/main.c
@ -2900,6 +2900,17 @@ static void FindWin32CACert(struct Configurable *config,
|
|||||||
#define RETRY_SLEEP_DEFAULT 1000 /* ms */
|
#define RETRY_SLEEP_DEFAULT 1000 /* ms */
|
||||||
#define RETRY_SLEEP_MAX 600000 /* ms == 10 minutes */
|
#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
|
static int
|
||||||
operate(struct Configurable *config, int argc, char *argv[])
|
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)
|
if(uploadfile && config->resume_from_current)
|
||||||
config->resume_from = -1; /* -1 will then force get-it-yourself */
|
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
|
/* we send the output to a tty, therefore we switch off the progress
|
||||||
meter */
|
meter */
|
||||||
config->conf |= CONF_NOPROGRESS;
|
config->conf |= CONF_NOPROGRESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user