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

Unified Diff: net/socket/socks5_client_socket.h

Issue 552164: Merge 34903, 34928, 35008, 35549, 36054 to the 249s branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/249s/src/
Patch Set: Fix some other merge conflicts Created 10 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_service_unittest.cc ('k') | net/socket/socks5_client_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socks5_client_socket.h
===================================================================
--- net/socket/socks5_client_socket.h (revision 37149)
+++ net/socket/socks5_client_socket.h (working copy)
@@ -31,9 +31,12 @@
//
// |req_info| contains the hostname and port to which the socket above will
// communicate to via the SOCKS layer.
+ //
+ // Although SOCKS 5 supports 3 different modes of addressing, we will
+ // always pass it a hostname. This means the DNS resolving is done
+ // proxy side.
SOCKS5ClientSocket(ClientSocket* transport_socket,
- const HostResolver::RequestInfo& req_info,
- HostResolver* host_resolver);
+ const HostResolver::RequestInfo& req_info);
// On destruction Disconnect() is called.
virtual ~SOCKS5ClientSocket();
@@ -58,13 +61,7 @@
#endif
private:
- FRIEND_TEST(SOCKS5ClientSocketTest, IPv6Domain);
- FRIEND_TEST(SOCKS5ClientSocketTest, FailedDNS);
- FRIEND_TEST(SOCKS5ClientSocketTest, CompleteHandshake);
-
enum State {
- STATE_RESOLVE_HOST,
- STATE_RESOLVE_HOST_COMPLETE,
STATE_GREET_WRITE,
STATE_GREET_WRITE_COMPLETE,
STATE_GREET_READ,
@@ -76,12 +73,9 @@
STATE_NONE,
};
- // State of the SOCKSv5 handshake. Before host resolution all connections
- // are kEndPointFailedDomain. If DNS lookup fails, we move to
- // kEndPointFailedDomain, otherwise the IPv4/IPv6 address as resolved.
+ // Addressing type that can be specified in requests or responses.
enum SocksEndPointAddressType {
- kEndPointUnresolved,
- kEndPointFailedDomain = 0x03,
+ kEndPointDomain = 0x03,
kEndPointResolvedIPv4 = 0x01,
kEndPointResolvedIPv6 = 0x04,
};
@@ -97,8 +91,6 @@
void OnIOComplete(int result);
int DoLoop(int last_io_result);
- int DoResolveHost();
- int DoResolveHostComplete(int result);
int DoHandshakeRead();
int DoHandshakeReadComplete(int result);
int DoHandshakeWrite();
@@ -118,7 +110,6 @@
scoped_ptr<ClientSocket> transport_;
State next_state_;
- SocksEndPointAddressType address_type_;
// Stores the callback to the layer above, called on completing Connect().
CompletionCallback* user_callback_;
@@ -142,9 +133,6 @@
size_t read_header_size;
- // Used to resolve the hostname to which the SOCKS proxy will connect.
- SingleRequestHostResolver host_resolver_;
- AddressList addresses_;
HostResolver::RequestInfo host_request_info_;
scoped_refptr<LoadLog> load_log_;
« no previous file with comments | « net/proxy/proxy_service_unittest.cc ('k') | net/socket/socks5_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698