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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // for the proxy to use to reach the original URL via TCP. But | 805 // for the proxy to use to reach the original URL via TCP. But |
806 // the alternate request will be going via UDP to a different port. | 806 // the alternate request will be going via UDP to a different port. |
807 GURL::Replacements replacements; | 807 GURL::Replacements replacements; |
808 // new_port needs to be in scope here because GURL::Replacements references | 808 // new_port needs to be in scope here because GURL::Replacements references |
809 // the memory contained by it directly. | 809 // the memory contained by it directly. |
810 const std::string new_port = base::UintToString(alternative_service_.port); | 810 const std::string new_port = base::UintToString(alternative_service_.port); |
811 replacements.SetSchemeStr("https"); | 811 replacements.SetSchemeStr("https"); |
812 replacements.SetPortStr(new_port); | 812 replacements.SetPortStr(new_port); |
813 url_for_proxy = url_for_proxy.ReplaceComponents(replacements); | 813 url_for_proxy = url_for_proxy.ReplaceComponents(replacements); |
814 } | 814 } |
| 815 |
815 return session_->proxy_service()->ResolveProxy( | 816 return session_->proxy_service()->ResolveProxy( |
816 url_for_proxy, request_info_.load_flags, &proxy_info_, io_callback_, | 817 url_for_proxy, request_info_.load_flags, &proxy_info_, io_callback_, |
817 &pac_request_, session_->params().proxy_delegate, net_log_); | 818 &pac_request_, session_->params().proxy_delegate, request_info_.method, |
| 819 net_log_); |
818 } | 820 } |
819 | 821 |
820 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { | 822 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { |
821 pac_request_ = NULL; | 823 pac_request_ = NULL; |
822 | 824 |
823 if (result == OK) { | 825 if (result == OK) { |
824 // Remove unsupported proxies from the list. | 826 // Remove unsupported proxies from the list. |
825 int supported_proxies = | 827 int supported_proxies = |
826 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP | | 828 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP | |
827 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 | | 829 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 | |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 if (request_info_.load_flags & LOAD_BYPASS_PROXY) | 1541 if (request_info_.load_flags & LOAD_BYPASS_PROXY) |
1540 return error; | 1542 return error; |
1541 | 1543 |
1542 if (proxy_info_.is_https() && proxy_ssl_config_.send_client_cert) { | 1544 if (proxy_info_.is_https() && proxy_ssl_config_.send_client_cert) { |
1543 session_->ssl_client_auth_cache()->Remove( | 1545 session_->ssl_client_auth_cache()->Remove( |
1544 proxy_info_.proxy_server().host_port_pair()); | 1546 proxy_info_.proxy_server().host_port_pair()); |
1545 } | 1547 } |
1546 | 1548 |
1547 int rv = session_->proxy_service()->ReconsiderProxyAfterError( | 1549 int rv = session_->proxy_service()->ReconsiderProxyAfterError( |
1548 request_info_.url, request_info_.load_flags, error, &proxy_info_, | 1550 request_info_.url, request_info_.load_flags, error, &proxy_info_, |
1549 io_callback_, &pac_request_, session_->params().proxy_delegate, net_log_); | 1551 io_callback_, &pac_request_, session_->params().proxy_delegate, |
| 1552 request_info_.method, net_log_); |
1550 if (rv == OK || rv == ERR_IO_PENDING) { | 1553 if (rv == OK || rv == ERR_IO_PENDING) { |
1551 // If the error was during connection setup, there is no socket to | 1554 // If the error was during connection setup, there is no socket to |
1552 // disconnect. | 1555 // disconnect. |
1553 if (connection_->socket()) | 1556 if (connection_->socket()) |
1554 connection_->socket()->Disconnect(); | 1557 connection_->socket()->Disconnect(); |
1555 connection_->Reset(); | 1558 connection_->Reset(); |
1556 if (request_) | 1559 if (request_) |
1557 request_->RemoveRequestFromSpdySessionRequestMap(); | 1560 request_->RemoveRequestFromSpdySessionRequestMap(); |
1558 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 1561 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
1559 } else { | 1562 } else { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 if (connection_->socket()) { | 1727 if (connection_->socket()) { |
1725 ConnectionAttempts socket_attempts; | 1728 ConnectionAttempts socket_attempts; |
1726 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1729 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
1727 request_->AddConnectionAttempts(socket_attempts); | 1730 request_->AddConnectionAttempts(socket_attempts); |
1728 } else { | 1731 } else { |
1729 request_->AddConnectionAttempts(connection_->connection_attempts()); | 1732 request_->AddConnectionAttempts(connection_->connection_attempts()); |
1730 } | 1733 } |
1731 } | 1734 } |
1732 | 1735 |
1733 } // namespace net | 1736 } // namespace net |
OLD | NEW |