Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: net/socket_stream/socket_stream.cc

Issue 507033: When talking to a SOCKS v5 proxy, default to sending addresses as raw domains... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // TODO(ukai): code is similar with http_network_transaction.cc. We should 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should
6 // think about ways to share code, if possible. 6 // think about ways to share code, if possible.
7 7
8 #include "net/socket_stream/socket_stream.h" 8 #include "net/socket_stream/socket_stream.h"
9 9
10 #include <string> 10 #include <string>
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 int SocketStream::DoSOCKSConnect() { 692 int SocketStream::DoSOCKSConnect() {
693 DCHECK_EQ(kSOCKSProxy, proxy_mode_); 693 DCHECK_EQ(kSOCKSProxy, proxy_mode_);
694 694
695 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; 695 next_state_ = STATE_SOCKS_CONNECT_COMPLETE;
696 696
697 ClientSocket* s = socket_.release(); 697 ClientSocket* s = socket_.release();
698 HostResolver::RequestInfo req_info(url_.HostNoBrackets(), 698 HostResolver::RequestInfo req_info(url_.HostNoBrackets(),
699 url_.EffectiveIntPort()); 699 url_.EffectiveIntPort());
700 700
701 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) 701 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5)
702 s = new SOCKS5ClientSocket(s, req_info, host_resolver_.get()); 702 s = new SOCKS5ClientSocket(s, req_info, NULL /*use proxy-side resolving*/);
wtc 2009/12/17 23:23:04 Maybe you can just say "proxy-side resolving" to d
703 else 703 else
704 s = new SOCKSClientSocket(s, req_info, host_resolver_.get()); 704 s = new SOCKSClientSocket(s, req_info, host_resolver_.get());
705 socket_.reset(s); 705 socket_.reset(s);
706 metrics_->OnSOCKSProxy(); 706 metrics_->OnSOCKSProxy();
707 return socket_->Connect(&io_callback_, load_log_); 707 return socket_->Connect(&io_callback_, load_log_);
708 } 708 }
709 709
710 int SocketStream::DoSOCKSConnectComplete(int result) { 710 int SocketStream::DoSOCKSConnectComplete(int result) {
711 DCHECK_EQ(kSOCKSProxy, proxy_mode_); 711 DCHECK_EQ(kSOCKSProxy, proxy_mode_);
712 712
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 return context_->proxy_service(); 897 return context_->proxy_service();
898 } 898 }
899 899
900 void SocketStream::GetInfoForTracker( 900 void SocketStream::GetInfoForTracker(
901 RequestTracker<SocketStream>::RecentRequestInfo* info) const { 901 RequestTracker<SocketStream>::RecentRequestInfo* info) const {
902 info->original_url = url_; 902 info->original_url = url_;
903 info->load_log = load_log_; 903 info->load_log = load_log_;
904 } 904 }
905 905
906 } // namespace net 906 } // namespace net
OLDNEW
« net/http/http_network_transaction.cc ('K') | « net/socket/socks5_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698