aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-10-27 22:05:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-10-27 22:05:38 +0000
commit966fa848a0213be52d3a4b3787c36ec7c5553f22 (patch)
tree113fe21384b7289127ac36f3cfb501dd6ee0571f /lib/transfer.c
parent6f8fe67ace4346c3c22fb3348d54ba1cfeb59669 (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 'lib/transfer.c')
-rw-r--r--lib/transfer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 13f31e9bc..1706ccb6f 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1765,7 +1765,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
size_t newlen;
char *newest;
- if (data->set.maxredirs &&
+ if ((data->set.maxredirs != -1) &&
(data->set.followlocation >= data->set.maxredirs)) {
failf(data,"Maximum (%d) redirects followed", data->set.maxredirs);
return CURLE_TOO_MANY_REDIRECTS;