aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-07-15 23:06:02 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-07-15 23:06:02 +0000
commit79749f8eb4a81c0a9743eaa71dfa03cc525da674 (patch)
tree84827846b130e23575bed7aeab2eb08e0b9e687e
parentb036986b3e8c07effde44b6262b3ff38ee68bb89 (diff)
Fix to the endless loop of bad Basic authentication as reported in Cris
Bailiff's bug report 768275.
-rw-r--r--lib/transfer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 98cf70c1d..3a6ad2203 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -794,7 +794,15 @@ CURLcode Curl_readwrite(struct connectdata *conn,
}
}
else if(checkprefix("Basic", start)) {
- if(data->state.authwant & CURLAUTH_BASIC) {
+ if((data->state.authwant == CURLAUTH_BASIC) &&
+ (k->httpcode == 401)) {
+ /* We asked for Basic authentication but got a 401 back
+ anyway, which basicly means our name+password isn't
+ valid. */
+ data->state.authavail = CURLAUTH_NONE;
+ infof(data, "Authentication problem. Ignoring this.\n");
+ }
+ else if(data->state.authwant & CURLAUTH_BASIC) {
data->state.authavail |= CURLAUTH_BASIC;
}
}