From cd7a0f829fcd9ee5c58d7f20147b3d1ee77a431b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 19 Jun 2004 10:10:24 +0000 Subject: [PATCH] When doing auth negotiations or authprobing, we only consider HTTP code <300 to be good. --- lib/http.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/http.c b/lib/http.c index 14f45881d..74422c58e 100644 --- a/lib/http.c +++ b/lib/http.c @@ -209,13 +209,15 @@ CURLcode Curl_http_auth_act(struct connectdata *conn) return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK; if(conn->bits.user_passwd && - ((conn->keep.httpcode == 401) || conn->bits.authprobe)) { + ((conn->keep.httpcode == 401) || + (conn->bits.authprobe && conn->keep.httpcode < 300))) { pickhost = pickoneauth(&data->state.authhost); if(!pickhost) data->state.authproblem = TRUE; } if(conn->bits.proxy_user_passwd && - ((conn->keep.httpcode == 407) || conn->bits.authprobe) ) { + ((conn->keep.httpcode == 407) || + (conn->bits.authprobe && conn->keep.httpcode < 300))) { pickproxy = pickoneauth(&data->state.authproxy); if(!pickproxy) data->state.authproblem = TRUE; @@ -224,8 +226,9 @@ CURLcode Curl_http_auth_act(struct connectdata *conn) if(pickhost || pickproxy) conn->newurl = strdup(data->change.url); /* clone URL */ - else if((data->info.httpcode < 400) && - (!data->state.authhost.done)) { + else if((conn->keep.httpcode < 300) && + (!data->state.authhost.done) && + conn->bits.authprobe) { /* no (known) authentication available, authentication is not "done" yet and no authentication seems to be required and