| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/field_trial.h" | 10 #include "base/field_trial.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; | 646 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; |
| 647 | 647 |
| 648 // Add a SOCKS connection on top of our existing transport socket. | 648 // Add a SOCKS connection on top of our existing transport socket. |
| 649 ClientSocket* s = connection_.release_socket(); | 649 ClientSocket* s = connection_.release_socket(); |
| 650 HostResolver::RequestInfo req_info(request_->url.HostNoBrackets(), | 650 HostResolver::RequestInfo req_info(request_->url.HostNoBrackets(), |
| 651 request_->url.EffectiveIntPort()); | 651 request_->url.EffectiveIntPort()); |
| 652 req_info.set_referrer(request_->referrer); | 652 req_info.set_referrer(request_->referrer); |
| 653 | 653 |
| 654 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) | 654 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) |
| 655 s = new SOCKS5ClientSocket(s, req_info, NULL /*use proxy-side resolving*/); | 655 s = new SOCKS5ClientSocket(s, req_info); |
| 656 else | 656 else |
| 657 s = new SOCKSClientSocket(s, req_info, session_->host_resolver()); | 657 s = new SOCKSClientSocket(s, req_info, session_->host_resolver()); |
| 658 connection_.set_socket(s); | 658 connection_.set_socket(s); |
| 659 return connection_.socket()->Connect(&io_callback_, load_log_); | 659 return connection_.socket()->Connect(&io_callback_, load_log_); |
| 660 } | 660 } |
| 661 | 661 |
| 662 int HttpNetworkTransaction::DoSOCKSConnectComplete(int result) { | 662 int HttpNetworkTransaction::DoSOCKSConnectComplete(int result) { |
| 663 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 663 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
| 664 | 664 |
| 665 if (result == OK) { | 665 if (result == OK) { |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 AuthChallengeInfo* auth_info = new AuthChallengeInfo; | 1682 AuthChallengeInfo* auth_info = new AuthChallengeInfo; |
| 1683 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; | 1683 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; |
| 1684 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); | 1684 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); |
| 1685 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); | 1685 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); |
| 1686 // TODO(eroman): decode realm according to RFC 2047. | 1686 // TODO(eroman): decode realm according to RFC 2047. |
| 1687 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); | 1687 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); |
| 1688 response_.auth_challenge = auth_info; | 1688 response_.auth_challenge = auth_info; |
| 1689 } | 1689 } |
| 1690 | 1690 |
| 1691 } // namespace net | 1691 } // namespace net |
| OLD | NEW |