James Griffiths' max-redirs fix

This commit is contained in:
Daniel Stenberg
2000-11-28 09:05:47 +00:00
parent d4cd079b9c
commit b8f7d94ef1
3 changed files with 12 additions and 2 deletions

View File

@@ -624,11 +624,17 @@ CURLcode curl_transfer(CURL *curl)
if((res == CURLE_OK) && data->newurl) {
/* Location: redirect
This is assumed to happen for HTTP(S) only!
*/
*/
char prot[16];
char path[URL_MAX_LENGTH];
if (data->maxredirs && (data->followlocation >= data->maxredirs)) {
failf(data,"Maximum (%d) redirects followed", data->maxredirs);
curl_disconnect(c_connect);
res=CURLE_TOO_MANY_REDIRECTS;
break;
}
/* mark the next request as a followed location: */
data->bits.this_is_a_follow = TRUE;