| Index: net/http/http_auth_controller.cc
|
| diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc
|
| index d5c0c891da68ec28009de5d3b620a97261af1c4a..7ad290e448bedadda9f24fdf129c9f9f781c1764 100644
|
| --- a/net/http/http_auth_controller.cc
|
| +++ b/net/http/http_auth_controller.cc
|
| @@ -157,13 +157,13 @@ int HttpAuthController::MaybeGenerateAuthToken(
|
| credentials, request,
|
| base::Bind(&HttpAuthController::OnIOComplete, base::Unretained(this)),
|
| &auth_token_);
|
| - if (DisableOnAuthHandlerResult(rv))
|
| - rv = OK;
|
| - if (rv == ERR_IO_PENDING)
|
| +
|
| + if (rv == ERR_IO_PENDING) {
|
| callback_ = callback;
|
| - else
|
| - OnIOComplete(rv);
|
| - return rv;
|
| + return rv;
|
| + }
|
| +
|
| + return HandleGenerateTokenResult(rv);
|
| }
|
|
|
| bool HttpAuthController::SelectPreemptiveAuth(const BoundNetLog& net_log) {
|
| @@ -470,10 +470,21 @@ void HttpAuthController::PopulateAuthChallenge() {
|
| auth_info_->realm = handler_->realm();
|
| }
|
|
|
| -bool HttpAuthController::DisableOnAuthHandlerResult(int result) {
|
| +int HttpAuthController::HandleGenerateTokenResult(int result) {
|
| DCHECK(CalledOnValidThread());
|
| -
|
| switch (result) {
|
| + case ERR_INVALID_AUTH_CREDENTIALS:
|
| + // If the GenerateAuthToken call fails with this error, this means that
|
| + // the handler can no longer be used. However, the authentication scheme
|
| + // is considered still usable. This allows a scheme that attempted and
|
| + // failed to use default credentials to recover and use explicit
|
| + // credentials.
|
| + //
|
| + // If the handler does not support any remaining identity sources, then
|
| + // the authentication controller will pick another authentication handler.
|
| + auth_token_.clear();
|
| + return OK;
|
| +
|
| // Occurs with GSSAPI, if the user has not already logged in.
|
| case ERR_MISSING_AUTH_CREDENTIALS:
|
|
|
| @@ -493,17 +504,16 @@ bool HttpAuthController::DisableOnAuthHandlerResult(int result) {
|
| // succeed.
|
| DisableAuthScheme(handler_->auth_scheme());
|
| auth_token_.clear();
|
| - return true;
|
| + return OK;
|
|
|
| default:
|
| - return false;
|
| + return result;
|
| }
|
| }
|
|
|
| void HttpAuthController::OnIOComplete(int result) {
|
| DCHECK(CalledOnValidThread());
|
| - if (DisableOnAuthHandlerResult(result))
|
| - result = OK;
|
| + result = HandleGenerateTokenResult(result);
|
| if (!callback_.is_null()) {
|
| CompletionCallback c = callback_;
|
| callback_.Reset();
|
|
|