diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-10-27 22:05:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-10-27 22:05:38 +0000 |
commit | 966fa848a0213be52d3a4b3787c36ec7c5553f22 (patch) | |
tree | 113fe21384b7289127ac36f3cfb501dd6ee0571f /src | |
parent | 6f8fe67ace4346c3c22fb3348d54ba1cfeb59669 (diff) |
Nis Jorgensen filed bug report #1338648
(http://curl.haxx.se/bug/view.cgi?id=1338648) which really is more of a
feature request, but anyway. It pointed out that --max-redirs did not allow
it to be set to 0, which then would return an error code on the first
Location: found. Based on Nis' patch, now libcurl supports CURLOPT_MAXREDIRS
set to 0, or -1 for infinity. Added test case 274 to verify.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c index 33200cea0..99edc61d7 100644 --- a/src/main.c +++ b/src/main.c @@ -3211,6 +3211,7 @@ operate(struct Configurable *config, int argc, char *argv[]) config->create_dirs=FALSE; config->lastrecvtime = curlx_tvnow(); config->lastsendtime = curlx_tvnow(); + config->maxredirs = DEFAULT_MAXREDIRS; if(argc>1 && (!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) && @@ -3803,11 +3804,7 @@ operate(struct Configurable *config, int argc, char *argv[]) curl_easy_setopt(curl, CURLOPT_FILETIME, TRUE); } - if (config->maxredirs) - curl_easy_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs); - else - curl_easy_setopt(curl, CURLOPT_MAXREDIRS, DEFAULT_MAXREDIRS); - + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs); curl_easy_setopt(curl, CURLOPT_CRLF, config->crlf); curl_easy_setopt(curl, CURLOPT_QUOTE, config->quote); curl_easy_setopt(curl, CURLOPT_POSTQUOTE, config->postquote); |