Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 int SSLConnectJob::DoTunnelConnectComplete(int result) { | 253 int SSLConnectJob::DoTunnelConnectComplete(int result) { |
| 254 // Extract the information needed to prompt for appropriate proxy | 254 // Extract the information needed to prompt for appropriate proxy |
| 255 // authentication so that when ClientSocketPoolBaseHelper calls | 255 // authentication so that when ClientSocketPoolBaseHelper calls |
| 256 // |GetAdditionalErrorState|, we can easily set the state. | 256 // |GetAdditionalErrorState|, we can easily set the state. |
| 257 if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { | 257 if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
| 258 error_response_info_ = transport_socket_handle_->ssl_error_response_info(); | 258 error_response_info_ = transport_socket_handle_->ssl_error_response_info(); |
| 259 } else if (result == ERR_PROXY_AUTH_REQUESTED) { | 259 } else if (result == ERR_PROXY_AUTH_REQUESTED) { |
| 260 ClientSocket* socket = transport_socket_handle_->socket(); | 260 ClientSocket* socket = transport_socket_handle_->socket(); |
| 261 HttpProxyClientSocket* tunnel_socket = | 261 HttpProxyClientSocket* tunnel_socket = |
| 262 static_cast<HttpProxyClientSocket*>(socket); | 262 static_cast<HttpProxyClientSocket*>(socket); |
| 263 error_response_info_ = *tunnel_socket->GetResponseInfo(); | 263 error_response_info_ = *tunnel_socket->GetConnectResponseInfo(); |
| 264 } else if (result == ERR_HTTPS_PROXY_TUNNEL_CONNECTION_RESPONSE) { | |
| 265 error_response_info_ = transport_socket_handle_->ssl_error_response_info(); | |
| 266 pending_https_proxy_response_stream_.reset( | |
| 267 transport_socket_handle_-> | |
|
vandebo (ex-Chrome)
2010/12/04 00:30:37
Indeed, you get the pending https proxy response s
| |
| 268 release_pending_https_proxy_response_stream()); | |
| 264 } | 269 } |
| 265 if (result < 0) | 270 if (result < 0) |
| 266 return result; | 271 return result; |
| 267 | 272 |
| 268 next_state_ = STATE_SSL_CONNECT; | 273 next_state_ = STATE_SSL_CONNECT; |
| 269 return result; | 274 return result; |
| 270 } | 275 } |
| 271 | 276 |
| 272 void SSLConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) { | 277 void SSLConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) { |
| 273 // Headers in |error_response_info_| indicate a proxy tunnel setup | 278 // Headers in |error_response_info_| indicate a proxy tunnel setup |
| 274 // problem. See DoTunnelConnectComplete. | 279 // problem. See DoTunnelConnectComplete. |
| 275 if (error_response_info_.headers) { | 280 if (error_response_info_.headers) { |
| 276 handle->set_pending_http_proxy_connection( | 281 handle->set_pending_http_proxy_connection( |
| 277 transport_socket_handle_.release()); | 282 transport_socket_handle_.release()); |
| 278 } | 283 } |
| 279 handle->set_ssl_error_response_info(error_response_info_); | 284 handle->set_ssl_error_response_info(error_response_info_); |
| 285 if (pending_https_proxy_response_stream_.get()) | |
| 286 handle->set_pending_https_proxy_response_stream( | |
| 287 pending_https_proxy_response_stream_.release()); | |
| 280 if (!ssl_connect_start_time_.is_null()) | 288 if (!ssl_connect_start_time_.is_null()) |
| 281 handle->set_is_ssl_error(true); | 289 handle->set_is_ssl_error(true); |
| 282 } | 290 } |
| 283 | 291 |
| 284 int SSLConnectJob::DoSSLConnect() { | 292 int SSLConnectJob::DoSSLConnect() { |
| 285 next_state_ = STATE_SSL_CONNECT_COMPLETE; | 293 next_state_ = STATE_SSL_CONNECT_COMPLETE; |
| 286 // Reset the timeout to just the time allowed for the SSL handshake. | 294 // Reset the timeout to just the time allowed for the SSL handshake. |
| 287 ResetTimer(base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds)); | 295 ResetTimer(base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds)); |
| 288 ssl_connect_start_time_ = base::TimeTicks::Now(); | 296 ssl_connect_start_time_ = base::TimeTicks::Now(); |
| 289 | 297 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 list->Append(http_proxy_pool_->GetInfoAsValue("http_proxy_pool", | 522 list->Append(http_proxy_pool_->GetInfoAsValue("http_proxy_pool", |
| 515 "http_proxy_pool", | 523 "http_proxy_pool", |
| 516 true)); | 524 true)); |
| 517 } | 525 } |
| 518 dict->Set("nested_pools", list); | 526 dict->Set("nested_pools", list); |
| 519 } | 527 } |
| 520 return dict; | 528 return dict; |
| 521 } | 529 } |
| 522 | 530 |
| 523 } // namespace net | 531 } // namespace net |
| OLD | NEW |