diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 2 | ||||
-rw-r--r-- | lib/url.c | 2 | ||||
-rw-r--r-- | lib/urldata.h | 3 |
3 files changed, 4 insertions, 3 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; @@ -320,7 +320,7 @@ CURLcode Curl_open(struct SessionHandle **curl) data->set.infilesize = -1; /* we don't know any size */ data->set.postfieldsize = -1; - + data->set.maxredirs = -1; /* allow any amount by default */ data->state.current_speed = -1; /* init to negative == impossible */ data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */ diff --git a/lib/urldata.h b/lib/urldata.h index 87a751f6f..b5b2d8040 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -956,7 +956,8 @@ struct UserDefined { char *set_range; /* range, if used. See README for detailed specification on this syntax. */ long followlocation; /* as in HTTP Location: */ - long maxredirs; /* maximum no. of http(s) redirects to follow */ + long maxredirs; /* maximum no. of http(s) redirects to follow, set to -1 + for infinity */ char *set_referer; /* custom string */ bool free_referer; /* set TRUE if 'referer' points to a string we allocated */ |