aboutsummaryrefslogtreecommitdiff
path: root/lib/highlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/highlevel.c')
-rw-r--r--lib/highlevel.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/highlevel.c b/lib/highlevel.c
index dc7acc130..b3bb9e157 100644
--- a/lib/highlevel.c
+++ b/lib/highlevel.c
@@ -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;