redirect: store the "would redirect to" URL when max redirs is reached

Test 1261 added to verify.

Reported-by: Lloyd Fournier

Fixes #1489
Closes #1497
This commit is contained in:
Daniel Stenberg 2017-05-23 10:32:18 +02:00
parent 48f2a96a60
commit bba59073c5
5 changed files with 94 additions and 38 deletions

View file

@ -1715,20 +1715,18 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
else {
/* Follow failed */
result = drc;
free(newurl);
}
}
else {
/* done didn't return OK or SEND_ERROR */
result = drc;
free(newurl);
}
}
else {
/* Have error handler disconnect conn if we can't retry */
stream_error = TRUE;
free(newurl);
}
free(newurl);
}
else {
/* failure detected */
@ -1963,9 +1961,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(!result) {
multistate(data, CURLM_STATE_CONNECT);
rc = CURLM_CALL_MULTI_PERFORM;
newurl = NULL; /* handed over the memory ownership to
Curl_follow(), make sure we don't free() it
here */
}
}
}
@ -1979,9 +1974,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
newurl = data->req.location;
data->req.location = NULL;
result = Curl_follow(data, newurl, FOLLOW_FAKE);
if(!result)
newurl = NULL; /* allocation was handed over Curl_follow() */
else
if(result)
stream_error = TRUE;
}