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