From b8f91e6943ab08a7975eee7efa38cd53372d77cd Mon Sep 17 00:00:00 2001
From: Joe Mason <jmason@rim.com>
Date: Wed, 18 Jul 2012 09:44:48 -0400
Subject: [PATCH] Reset authp->picked whenever there's an authproblem

---
 lib/io-pkt/dist/curl/lib/http.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/io-pkt/dist/curl/lib/http.c b/lib/io-pkt/dist/curl/lib/http.c
index c1be320..86a225b 100644
--- a/lib/io-pkt/dist/curl/lib/http.c
+++ b/lib/io-pkt/dist/curl/lib/http.c
@@ -747,6 +747,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
              this back, we're in trouble */
           infof(data, "Authentication problem. Ignoring this.\n");
           data->state.authproblem = TRUE;
+          authp->picked = CURLAUTH_NONE;
         }
         else {
           neg = Curl_input_negotiate(conn, (bool)(httpcode == 407), start);
@@ -763,8 +764,10 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
               (*data->set.qnx_negotiate_function)(data->set.qnx_negotiate_data);
 #endif
           }
-          else
+          else {
             data->state.authproblem = TRUE;
+            authp->picked = CURLAUTH_NONE;
+          }
         }
       }
     }
@@ -807,6 +810,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
           else {
             infof(data, "Authentication problem. Ignoring this.\n");
             data->state.authproblem = TRUE;
+            authp->picked = CURLAUTH_NONE;
           }
         }
       }
@@ -831,6 +835,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
             if(CURLDIGEST_FINE != dig) {
               infof(data, "Authentication problem. Ignoring this.\n");
               data->state.authproblem = TRUE;
+              authp->picked = CURLAUTH_NONE;
             }
           }
         }
@@ -846,6 +851,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
               authp->avail = CURLAUTH_NONE;
               infof(data, "Authentication problem. Ignoring this.\n");
               data->state.authproblem = TRUE;
+              authp->picked = CURLAUTH_NONE;
             }
           }
 
-- 
1.7.5.4

