Toby Peterson added CURLOPT_IGNORE_CONTENT_LENGTH to the library, accessible
from the command line tool with --ignore-content-length. This will make it easier to download files from Apache 1.x (and similar) servers that are still having problems serving files larger than 2 or 4 GB. When this option is enabled, curl will simply have to wait for the server to close the connection to signal end of transfer. I wrote test case 269 that runs a simple test that this works.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user