diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 3b9046d64..e0eb6bbc7 100644 --- a/src/main.c +++ b/src/main.c @@ -356,6 +356,8 @@ struct Configurable { struct curl_slist *tp_postquote; struct curl_slist *tp_prequote; char *ftp_account; /* for ACCT */ + + bool ignorecl; /* --ignore-content-length */ }; #define WARN_PREFIX "Warning: " @@ -514,6 +516,7 @@ static void help(void) " -G/--get Send the -d data with a HTTP GET (H)", " -h/--help This help text", " -H/--header <line> Custom header to pass to server (H)", + " --ignore-content-length Ignore the HTTP Content-Length header", " -i/--include Include protocol headers in the output (H/F)", " -I/--head Show document info only", " -j/--junk-session-cookies Ignore session cookies read from file (H)", @@ -1309,6 +1312,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"$m", "ftp-account", TRUE}, {"$n", "proxy-anyauth", FALSE}, {"$o", "trace-time", FALSE}, + {"$p", "ignore-content-length", FALSE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, @@ -1702,6 +1706,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ case 'o': /* --trace-time */ config->tracetime ^= TRUE; break; + case 'p': /* --ignore-content-length */ + config->ignorecl ^= TRUE; + break; } break; case '#': /* --progress-bar */ @@ -3896,6 +3903,8 @@ operate(struct Configurable *config, int argc, char *argv[]) curl_easy_setopt(curl, CURLOPT_SOURCE_QUOTE, config->tp_quote); curl_easy_setopt(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account); + curl_easy_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl); + retry_numretries = config->req_retry; retrystart = curlx_tvnow(); |