mirror of
https://github.com/curl/curl.git
synced 2026-07-25 02:37:18 +03:00
Based on an error report by Philippe Vaucher, we no longer count a retried
connection setup as a follow-redirect. It turns out 1) this fails when a FTP connection is re-setup and 2) it does make the max-redirs counter behave wrong. This fix was not verified since the reporter vanished, but I believe this is the right fix nonetheless.
This commit is contained in:
parent
f3bc8e6ce1
commit
32bc30e210
3 changed files with 19 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue