aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-08-24 10:57:28 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-08-24 10:57:28 +0000
commita4773fcbbbf42a25c1037573fbab58aa275b9ed1 (patch)
tree965b924386052986179eb3717aeab0d82744bd54 /src
parent1e038c4bc6ecc43bdbbe0e66a70001c7fe967bf6 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
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();