Index: net/socket/socks5_client_socket.h |
=================================================================== |
--- net/socket/socks5_client_socket.h (revision 34903) |
+++ net/socket/socks5_client_socket.h (working copy) |
@@ -32,23 +32,11 @@ |
// |req_info| contains the hostname and port to which the socket above will |
// communicate to via the SOCKS layer. |
// |
- // SOCKS5 supports three modes of specifying connection endpoints: |
- // (1) as an IPv4 address. |
- // (2) as an IPv6 address. |
- // (3) as a hostname string. |
- // |
- // To select mode (3), pass NULL for |host_resolver|. |
- // |
- // Otherwise if a non-NULL |host_resolver| is given, Connect() will first |
- // try to resolve the hostname using |host_resolver|, and pass that |
- // resolved address to the proxy server. If the resolve failed, Connect() |
- // will fall-back to mode (3) and simply send the unresolved hosname string |
- // to the SOCKS v5 proxy server. |
- // |
- // Passing NULL for |host_resolver| is the recommended default. |
+ // 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(); |
@@ -73,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, |
@@ -91,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, |
}; |
@@ -112,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(); |
@@ -133,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_; |
@@ -157,11 +133,6 @@ |
size_t read_header_size; |
- // If non-NULL, we will use this host resolver to resolve DNS client-side |
- // (and fall back to proxy-side resolving if it fails). |
- // Otherwise, we will do proxy-side DNS resolving. |
- scoped_ptr<SingleRequestHostResolver> host_resolver_; |
- AddressList addresses_; |
HostResolver::RequestInfo host_request_info_; |
scoped_refptr<LoadLog> load_log_; |