OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "jingle/glue/proxy_resolving_client_socket.h" | 5 #include "jingle/glue/proxy_resolving_client_socket.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
13 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "net/http/http_network_session.h" | 15 #include "net/http/http_network_session.h" |
16 #include "net/http/proxy_client_socket.h" | |
16 #include "net/socket/client_socket_handle.h" | 17 #include "net/socket/client_socket_handle.h" |
17 #include "net/socket/client_socket_pool_manager.h" | 18 #include "net/socket/client_socket_pool_manager.h" |
18 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
19 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
20 | 21 |
21 namespace jingle_glue { | 22 namespace jingle_glue { |
22 | 23 |
23 ProxyResolvingClientSocket::ProxyResolvingClientSocket( | 24 ProxyResolvingClientSocket::ProxyResolvingClientSocket( |
24 net::ClientSocketFactory* socket_factory, | 25 net::ClientSocketFactory* socket_factory, |
25 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, | 26 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 case net::ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: | 264 case net::ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: |
264 // Remap the SOCKS-specific "host unreachable" error to a more | 265 // Remap the SOCKS-specific "host unreachable" error to a more |
265 // generic error code (this way consumers like the link doctor | 266 // generic error code (this way consumers like the link doctor |
266 // know to substitute their error page). | 267 // know to substitute their error page). |
267 // | 268 // |
268 // Note that if the host resolving was done by the SOCSK5 proxy, we can't | 269 // Note that if the host resolving was done by the SOCSK5 proxy, we can't |
269 // differentiate between a proxy-side "host not found" versus a proxy-side | 270 // differentiate between a proxy-side "host not found" versus a proxy-side |
270 // "address unreachable" error, and will report both of these failures as | 271 // "address unreachable" error, and will report both of these failures as |
271 // ERR_ADDRESS_UNREACHABLE. | 272 // ERR_ADDRESS_UNREACHABLE. |
272 return net::ERR_ADDRESS_UNREACHABLE; | 273 return net::ERR_ADDRESS_UNREACHABLE; |
274 case net::ERR_PROXY_AUTH_REQUESTED: | |
275 return static_cast<net::ProxyClientSocket*>(transport_->socket()) | |
Ryan Sleevi
2014/08/26 21:41:18
This strikes me as a dangerous assumption that's n
asanka
2014/08/26 22:34:03
RestartWithAuth() only makes progress for the case
jiayl
2014/08/26 22:41:48
What do you suggest to do?
Does it return error if
| |
276 ->RestartWithAuth(connect_callback_); | |
273 default: | 277 default: |
274 return error; | 278 return error; |
275 } | 279 } |
276 | 280 |
277 if (proxy_info_.is_https() && ssl_config_.send_client_cert) { | 281 if (proxy_info_.is_https() && ssl_config_.send_client_cert) { |
278 network_session_->ssl_client_auth_cache()->Remove( | 282 network_session_->ssl_client_auth_cache()->Remove( |
279 proxy_info_.proxy_server().host_port_pair()); | 283 proxy_info_.proxy_server().host_port_pair()); |
280 } | 284 } |
281 | 285 |
282 int rv = network_session_->proxy_service()->ReconsiderProxyAfterError( | 286 int rv = network_session_->proxy_service()->ReconsiderProxyAfterError( |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 return false; | 403 return false; |
400 } | 404 } |
401 | 405 |
402 void ProxyResolvingClientSocket::CloseTransportSocket() { | 406 void ProxyResolvingClientSocket::CloseTransportSocket() { |
403 if (transport_.get() && transport_->socket()) | 407 if (transport_.get() && transport_->socket()) |
404 transport_->socket()->Disconnect(); | 408 transport_->socket()->Disconnect(); |
405 transport_.reset(); | 409 transport_.reset(); |
406 } | 410 } |
407 | 411 |
408 } // namespace jingle_glue | 412 } // namespace jingle_glue |
OLD | NEW |