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 "net/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 // for the proxy to use to reach the original URL via TCP. But | 863 // for the proxy to use to reach the original URL via TCP. But |
864 // the alternate request will be going via UDP to a different port. | 864 // the alternate request will be going via UDP to a different port. |
865 GURL::Replacements replacements; | 865 GURL::Replacements replacements; |
866 // new_port needs to be in scope here because GURL::Replacements references | 866 // new_port needs to be in scope here because GURL::Replacements references |
867 // the memory contained by it directly. | 867 // the memory contained by it directly. |
868 const std::string new_port = base::UintToString(alternative_service_.port); | 868 const std::string new_port = base::UintToString(alternative_service_.port); |
869 replacements.SetSchemeStr("https"); | 869 replacements.SetSchemeStr("https"); |
870 replacements.SetPortStr(new_port); | 870 replacements.SetPortStr(new_port); |
871 url_for_proxy = url_for_proxy.ReplaceComponents(replacements); | 871 url_for_proxy = url_for_proxy.ReplaceComponents(replacements); |
872 } | 872 } |
| 873 |
873 return session_->proxy_service()->ResolveProxy( | 874 return session_->proxy_service()->ResolveProxy( |
874 url_for_proxy, request_info_.load_flags, &proxy_info_, io_callback_, | 875 url_for_proxy, request_info_.method, request_info_.load_flags, |
875 &pac_request_, session_->params().proxy_delegate, net_log_); | 876 &proxy_info_, io_callback_, &pac_request_, |
| 877 session_->params().proxy_delegate, net_log_); |
876 } | 878 } |
877 | 879 |
878 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { | 880 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { |
879 pac_request_ = NULL; | 881 pac_request_ = NULL; |
880 | 882 |
881 if (result == OK) { | 883 if (result == OK) { |
882 // Remove unsupported proxies from the list. | 884 // Remove unsupported proxies from the list. |
883 int supported_proxies = | 885 int supported_proxies = |
884 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP | | 886 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP | |
885 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 | | 887 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 | |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 | 1605 |
1604 if (request_info_.load_flags & LOAD_BYPASS_PROXY) | 1606 if (request_info_.load_flags & LOAD_BYPASS_PROXY) |
1605 return error; | 1607 return error; |
1606 | 1608 |
1607 if (proxy_info_.is_https() && proxy_ssl_config_.send_client_cert) { | 1609 if (proxy_info_.is_https() && proxy_ssl_config_.send_client_cert) { |
1608 session_->ssl_client_auth_cache()->Remove( | 1610 session_->ssl_client_auth_cache()->Remove( |
1609 proxy_info_.proxy_server().host_port_pair()); | 1611 proxy_info_.proxy_server().host_port_pair()); |
1610 } | 1612 } |
1611 | 1613 |
1612 int rv = session_->proxy_service()->ReconsiderProxyAfterError( | 1614 int rv = session_->proxy_service()->ReconsiderProxyAfterError( |
1613 request_info_.url, request_info_.load_flags, error, &proxy_info_, | 1615 request_info_.url, request_info_.method, request_info_.load_flags, error, |
1614 io_callback_, &pac_request_, session_->params().proxy_delegate, net_log_); | 1616 &proxy_info_, io_callback_, &pac_request_, |
| 1617 session_->params().proxy_delegate, net_log_); |
1615 if (rv == OK || rv == ERR_IO_PENDING) { | 1618 if (rv == OK || rv == ERR_IO_PENDING) { |
1616 // If the error was during connection setup, there is no socket to | 1619 // If the error was during connection setup, there is no socket to |
1617 // disconnect. | 1620 // disconnect. |
1618 if (connection_->socket()) | 1621 if (connection_->socket()) |
1619 connection_->socket()->Disconnect(); | 1622 connection_->socket()->Disconnect(); |
1620 connection_->Reset(); | 1623 connection_->Reset(); |
1621 if (request_) | 1624 if (request_) |
1622 request_->RemoveRequestFromSpdySessionRequestMap(); | 1625 request_->RemoveRequestFromSpdySessionRequestMap(); |
1623 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 1626 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
1624 } else { | 1627 } else { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 if (connection_->socket()) { | 1792 if (connection_->socket()) { |
1790 ConnectionAttempts socket_attempts; | 1793 ConnectionAttempts socket_attempts; |
1791 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1794 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
1792 request_->AddConnectionAttempts(socket_attempts); | 1795 request_->AddConnectionAttempts(socket_attempts); |
1793 } else { | 1796 } else { |
1794 request_->AddConnectionAttempts(connection_->connection_attempts()); | 1797 request_->AddConnectionAttempts(connection_->connection_attempts()); |
1795 } | 1798 } |
1796 } | 1799 } |
1797 | 1800 |
1798 } // namespace net | 1801 } // namespace net |
OLD | NEW |