diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index f84594a9e..18f8f1124 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1765,17 +1765,18 @@ CURLcode Curl_follow(struct SessionHandle *data, size_t newlen; char *newest; - 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; - } + if(!retry) { + 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; + } - if(!retry) /* mark the next request as a followed location: */ data->state.this_is_a_follow = TRUE; - data->set.followlocation++; /* count location-followers */ + data->set.followlocation++; /* count location-followers */ + } if(data->set.http_auto_referer) { /* We are asked to automatically set the previous URL as the |