Index: net/http/http_network_transaction.cc |
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc |
index 2e5b4375aa66e1de06004ed7a136d9481abcb432..609c98df7a0d82893d2839f9b734cdf12ea41f2a 100644 |
--- a/net/http/http_network_transaction.cc |
+++ b/net/http/http_network_transaction.cc |
@@ -314,13 +314,18 @@ int HttpNetworkTransaction::RestartWithAuth( |
} |
pending_auth_target_ = HttpAuth::AUTH_NONE; |
- auth_controllers_[target]->ResetAuth(username, password); |
- |
if (target == HttpAuth::AUTH_PROXY && using_ssl_ && proxy_info_.is_http()) { |
DCHECK(establishing_tunnel_); |
+ DCHECK(auth_controllers_[target].get() == NULL); |
next_state_ = STATE_INIT_CONNECTION; |
+ auth_controllers_[target].reset(new HttpAuthController(target, |
+ AuthURL(target), |
+ session_)); |
+ auth_controllers_[target]->SetCredentials(username, password); |
ResetStateForRestart(); |
} else { |
+ auth_controllers_[target]->SetCredentials(username, password); |
+ auth_controllers_[target]->PrepareForAuthRestart(); |
PrepareForAuthRestart(target); |
} |
@@ -706,9 +711,9 @@ int HttpNetworkTransaction::DoInitConnection() { |
for (int i = 0; i < HttpAuth::AUTH_NUM_TARGETS; i++) { |
HttpAuth::Target target = static_cast<HttpAuth::Target>(i); |
if (!auth_controllers_[target].get()) |
- auth_controllers_[target] = new HttpAuthController(target, |
- AuthURL(target), |
- session_); |
+ auth_controllers_[target].reset(new HttpAuthController(target, |
+ AuthURL(target), |
+ session_)); |
} |
bool want_spdy = alternate_protocol_mode_ == kUsingAlternateProtocol |
@@ -765,14 +770,15 @@ int HttpNetworkTransaction::DoInitConnection() { |
request_->referrer, disable_resolver_cache); |
if (proxy_info_.is_http()) { |
- scoped_refptr<HttpAuthController> http_proxy_auth; |
+ scoped_ptr<HttpAuthController> http_proxy_auth; |
if (using_ssl_) { |
- http_proxy_auth = auth_controllers_[HttpAuth::AUTH_PROXY]; |
+ http_proxy_auth.reset( |
+ auth_controllers_[HttpAuth::AUTH_PROXY].release()); |
establishing_tunnel_ = true; |
} |
http_proxy_params = new HttpProxySocketParams(proxy_tcp_params, |
request_->url, endpoint_, |
- http_proxy_auth, |
+ http_proxy_auth.release(), |
using_ssl_); |
} else { |
DCHECK(proxy_info_.is_socks()); |