Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: net/socket/ssl_client_socket_pool.cc

Issue 3056040: Revert 54405 - Fix late binding induced mismatch of Socket and AuthController... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket_pool.h ('k') | net/socket/ssl_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_pool.cc
===================================================================
--- net/socket/ssl_client_socket_pool.cc (revision 54615)
+++ net/socket/ssl_client_socket_pool.cc (working copy)
@@ -103,6 +103,11 @@
}
int SSLConnectJob::ConnectInternal() {
+ DetermineFirstState();
+ return DoLoop(OK);
+}
+
+void SSLConnectJob::DetermineFirstState() {
switch (params_->proxy()) {
case ProxyServer::SCHEME_DIRECT:
next_state_ = STATE_TCP_CONNECT;
@@ -118,7 +123,6 @@
NOTREACHED() << "unknown proxy type";
break;
}
- return DoLoop(OK);
}
void SSLConnectJob::OnIOComplete(int result) {
@@ -210,7 +214,6 @@
int SSLConnectJob::DoTunnelConnect() {
DCHECK(http_proxy_pool_.get());
next_state_ = STATE_TUNNEL_CONNECT_COMPLETE;
-
transport_socket_handle_.reset(new ClientSocketHandle());
scoped_refptr<HttpProxySocketParams> http_proxy_params =
params_->http_proxy_params();
@@ -225,6 +228,12 @@
HttpProxyClientSocket* tunnel_socket =
static_cast<HttpProxyClientSocket*>(socket);
+ if (result == ERR_RETRY_CONNECTION) {
+ DetermineFirstState();
+ transport_socket_handle_->socket()->Disconnect();
+ return OK;
+ }
+
// Extract the information needed to prompt for the proxy authentication.
// so that when ClientSocketPoolBaseHelper calls |GetAdditionalErrorState|,
// we can easily set the state.
@@ -234,17 +243,20 @@
if (result < 0)
return result;
- DCHECK(tunnel_socket->IsConnected());
+ if (tunnel_socket->NeedsRestartWithAuth()) {
+ // We must have gotten an 'idle' tunnel socket that is waiting for auth.
+ // The HttpAuthController should have new credentials, we just need
+ // to retry.
+ next_state_ = STATE_TUNNEL_CONNECT_COMPLETE;
+ return tunnel_socket->RestartWithAuth(&callback_);
+ }
+
next_state_ = STATE_SSL_CONNECT;
return result;
}
void SSLConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) {
- if (error_response_info_.headers) {
- handle->set_ssl_error_response_info(error_response_info_);
- handle->set_pending_http_proxy_connection(
- transport_socket_handle_.release());
- }
+ handle->set_ssl_error_response_info(error_response_info_);
if (!ssl_connect_start_time_.is_null())
handle->set_is_ssl_error(true);
}
Property changes on: net\socket\ssl_client_socket_pool.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « net/socket/ssl_client_socket_pool.h ('k') | net/socket/ssl_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698