blob: 025d1aa242acddbc92875e87dec16a184d333a01 [file] [log] [blame]
[email protected]9eb7b11b2012-03-28 20:19:311// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]3cd17242009-06-23 02:59:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/socket/socks_client_socket.h"
6
7#include "base/basictypes.h"
[email protected]aa22b242011-11-16 18:58:298#include "base/bind.h"
[email protected]3cd17242009-06-23 02:59:029#include "base/compiler_specific.h"
[email protected]9eb7b11b2012-03-28 20:19:3110#include "base/sys_byteorder.h"
[email protected]3cd17242009-06-23 02:59:0211#include "net/base/io_buffer.h"
[email protected]9e743cd2010-03-16 07:03:5312#include "net/base/net_log.h"
[email protected]3cd17242009-06-23 02:59:0213#include "net/base/net_util.h"
[email protected]a796bcec2010-03-22 17:17:2614#include "net/socket/client_socket_handle.h"
[email protected]3cd17242009-06-23 02:59:0215
16namespace net {
17
18// Every SOCKS server requests a user-id from the client. It is optional
19// and we send an empty string.
20static const char kEmptyUserId[] = "";
21
[email protected]3cd17242009-06-23 02:59:0222// For SOCKS4, the client sends 8 bytes plus the size of the user-id.
[email protected]76a51ac82009-06-28 07:58:5823static const unsigned int kWriteHeaderSize = 8;
[email protected]3cd17242009-06-23 02:59:0224
[email protected]034d3892011-03-29 04:07:2125// For SOCKS4 the server sends 8 bytes for acknowledgement.
[email protected]76a51ac82009-06-28 07:58:5826static const unsigned int kReadHeaderSize = 8;
[email protected]3cd17242009-06-23 02:59:0227
28// Server Response codes for SOCKS.
29static const uint8 kServerResponseOk = 0x5A;
30static const uint8 kServerResponseRejected = 0x5B;
31static const uint8 kServerResponseNotReachable = 0x5C;
32static const uint8 kServerResponseMismatchedUserId = 0x5D;
33
34static const uint8 kSOCKSVersion4 = 0x04;
35static const uint8 kSOCKSStreamRequest = 0x01;
36
[email protected]034d3892011-03-29 04:07:2137// A struct holding the essential details of the SOCKS4 Server Request.
[email protected]3cd17242009-06-23 02:59:0238// The port in the header is stored in network byte order.
39struct SOCKS4ServerRequest {
40 uint8 version;
41 uint8 command;
42 uint16 nw_port;
43 uint8 ip[4];
44};
45COMPILE_ASSERT(sizeof(SOCKS4ServerRequest) == kWriteHeaderSize,
46 socks4_server_request_struct_wrong_size);
47
[email protected]034d3892011-03-29 04:07:2148// A struct holding details of the SOCKS4 Server Response.
[email protected]3cd17242009-06-23 02:59:0249struct SOCKS4ServerResponse {
50 uint8 reserved_null;
51 uint8 code;
52 uint16 port;
53 uint8 ip[4];
54};
55COMPILE_ASSERT(sizeof(SOCKS4ServerResponse) == kReadHeaderSize,
56 socks4_server_response_struct_wrong_size);
57
[email protected]a796bcec2010-03-22 17:17:2658SOCKSClientSocket::SOCKSClientSocket(ClientSocketHandle* transport_socket,
[email protected]3cd17242009-06-23 02:59:0259 const HostResolver::RequestInfo& req_info,
60 HostResolver* host_resolver)
[email protected]83039bb2011-12-09 18:43:5561 : transport_(transport_socket),
[email protected]3cd17242009-06-23 02:59:0262 next_state_(STATE_NONE),
[email protected]3cd17242009-06-23 02:59:0263 completed_handshake_(false),
64 bytes_sent_(0),
65 bytes_received_(0),
[email protected]76a51ac82009-06-28 07:58:5866 host_resolver_(host_resolver),
[email protected]a2006ece2010-04-23 16:44:0267 host_request_info_(req_info),
68 net_log_(transport_socket->socket()->NetLog()) {
[email protected]3cd17242009-06-23 02:59:0269}
70
[email protected]3268023f2011-05-05 00:08:1071SOCKSClientSocket::SOCKSClientSocket(StreamSocket* transport_socket,
[email protected]a796bcec2010-03-22 17:17:2672 const HostResolver::RequestInfo& req_info,
73 HostResolver* host_resolver)
[email protected]83039bb2011-12-09 18:43:5574 : transport_(new ClientSocketHandle()),
[email protected]a796bcec2010-03-22 17:17:2675 next_state_(STATE_NONE),
[email protected]a796bcec2010-03-22 17:17:2676 completed_handshake_(false),
77 bytes_sent_(0),
78 bytes_received_(0),
79 host_resolver_(host_resolver),
[email protected]a2006ece2010-04-23 16:44:0280 host_request_info_(req_info),
81 net_log_(transport_socket->NetLog()) {
[email protected]a796bcec2010-03-22 17:17:2682 transport_->set_socket(transport_socket);
83}
84
[email protected]3cd17242009-06-23 02:59:0285SOCKSClientSocket::~SOCKSClientSocket() {
86 Disconnect();
87}
88
[email protected]83039bb2011-12-09 18:43:5589int SOCKSClientSocket::Connect(const CompletionCallback& callback) {
[email protected]3cd17242009-06-23 02:59:0290 DCHECK(transport_.get());
[email protected]a796bcec2010-03-22 17:17:2691 DCHECK(transport_->socket());
[email protected]3cd17242009-06-23 02:59:0292 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:5593 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:0294
95 // If already connected, then just return OK.
96 if (completed_handshake_)
97 return OK;
98
99 next_state_ = STATE_RESOLVE_HOST;
[email protected]5a05c47a2009-11-02 23:25:19100
[email protected]ec11be62010-04-28 19:28:09101 net_log_.BeginEvent(NetLog::TYPE_SOCKS_CONNECT, NULL);
[email protected]3cd17242009-06-23 02:59:02102
103 int rv = DoLoop(OK);
[email protected]5a05c47a2009-11-02 23:25:19104 if (rv == ERR_IO_PENDING) {
[email protected]83039bb2011-12-09 18:43:55105 user_callback_ = callback;
[email protected]5a05c47a2009-11-02 23:25:19106 } else {
[email protected]d7fd1782011-02-08 19:16:43107 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv);
[email protected]5a05c47a2009-11-02 23:25:19108 }
[email protected]3cd17242009-06-23 02:59:02109 return rv;
110}
111
112void SOCKSClientSocket::Disconnect() {
113 completed_handshake_ = false;
[email protected]16a02742010-01-07 22:50:10114 host_resolver_.Cancel();
[email protected]a796bcec2010-03-22 17:17:26115 transport_->socket()->Disconnect();
[email protected]16a02742010-01-07 22:50:10116
117 // Reset other states to make sure they aren't mistakenly used later.
118 // These are the states initialized by Connect().
119 next_state_ = STATE_NONE;
[email protected]dbf036f2011-12-06 23:33:24120 user_callback_.Reset();
[email protected]3cd17242009-06-23 02:59:02121}
122
123bool SOCKSClientSocket::IsConnected() const {
[email protected]a796bcec2010-03-22 17:17:26124 return completed_handshake_ && transport_->socket()->IsConnected();
[email protected]3cd17242009-06-23 02:59:02125}
126
127bool SOCKSClientSocket::IsConnectedAndIdle() const {
[email protected]a796bcec2010-03-22 17:17:26128 return completed_handshake_ && transport_->socket()->IsConnectedAndIdle();
[email protected]3cd17242009-06-23 02:59:02129}
130
[email protected]e4be2dd2010-12-14 00:44:39131const BoundNetLog& SOCKSClientSocket::NetLog() const {
132 return net_log_;
133}
134
[email protected]9b5614a2010-08-25 20:29:45135void SOCKSClientSocket::SetSubresourceSpeculation() {
136 if (transport_.get() && transport_->socket()) {
137 transport_->socket()->SetSubresourceSpeculation();
138 } else {
139 NOTREACHED();
140 }
141}
142
143void SOCKSClientSocket::SetOmniboxSpeculation() {
144 if (transport_.get() && transport_->socket()) {
145 transport_->socket()->SetOmniboxSpeculation();
146 } else {
147 NOTREACHED();
148 }
149}
150
[email protected]0f873e82010-09-02 16:09:01151bool SOCKSClientSocket::WasEverUsed() const {
152 if (transport_.get() && transport_->socket()) {
153 return transport_->socket()->WasEverUsed();
154 }
155 NOTREACHED();
156 return false;
157}
158
[email protected]7f7e92392010-10-26 18:29:29159bool SOCKSClientSocket::UsingTCPFastOpen() const {
160 if (transport_.get() && transport_->socket()) {
161 return transport_->socket()->UsingTCPFastOpen();
162 }
163 NOTREACHED();
164 return false;
165}
166
[email protected]5e6efa52011-06-27 17:26:41167int64 SOCKSClientSocket::NumBytesRead() const {
168 if (transport_.get() && transport_->socket()) {
169 return transport_->socket()->NumBytesRead();
170 }
171 NOTREACHED();
172 return -1;
173}
174
175base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const {
176 if (transport_.get() && transport_->socket()) {
177 return transport_->socket()->GetConnectTimeMicros();
178 }
179 NOTREACHED();
180 return base::TimeDelta::FromMicroseconds(-1);
181}
182
[email protected]33661e482012-04-03 16:16:26183NextProto SOCKSClientSocket::GetNegotiatedProtocol() const {
184 if (transport_.get() && transport_->socket()) {
185 return transport_->socket()->GetNegotiatedProtocol();
186 }
187 NOTREACHED();
188 return kProtoUnknown;
189}
190
[email protected]3cd17242009-06-23 02:59:02191// Read is called by the transport layer above to read. This can only be done
192// if the SOCKS handshake is complete.
193int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len,
[email protected]3f55aa12011-12-07 02:03:33194 const CompletionCallback& callback) {
195 DCHECK(completed_handshake_);
196 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:55197 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02198
[email protected]a796bcec2010-03-22 17:17:26199 return transport_->socket()->Read(buf, buf_len, callback);
[email protected]3cd17242009-06-23 02:59:02200}
201
202// Write is called by the transport layer. This can only be done if the
203// SOCKS handshake is complete.
204int SOCKSClientSocket::Write(IOBuffer* buf, int buf_len,
[email protected]83039bb2011-12-09 18:43:55205 const CompletionCallback& callback) {
[email protected]3cd17242009-06-23 02:59:02206 DCHECK(completed_handshake_);
207 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:55208 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02209
[email protected]a796bcec2010-03-22 17:17:26210 return transport_->socket()->Write(buf, buf_len, callback);
[email protected]3cd17242009-06-23 02:59:02211}
212
[email protected]d3f66572009-09-09 22:38:04213bool SOCKSClientSocket::SetReceiveBufferSize(int32 size) {
[email protected]a796bcec2010-03-22 17:17:26214 return transport_->socket()->SetReceiveBufferSize(size);
[email protected]d3f66572009-09-09 22:38:04215}
216
217bool SOCKSClientSocket::SetSendBufferSize(int32 size) {
[email protected]a796bcec2010-03-22 17:17:26218 return transport_->socket()->SetSendBufferSize(size);
[email protected]d3f66572009-09-09 22:38:04219}
220
[email protected]3cd17242009-06-23 02:59:02221void SOCKSClientSocket::DoCallback(int result) {
222 DCHECK_NE(ERR_IO_PENDING, result);
[email protected]83039bb2011-12-09 18:43:55223 DCHECK(!user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02224
225 // Since Run() may result in Read being called,
226 // clear user_callback_ up front.
[email protected]83039bb2011-12-09 18:43:55227 CompletionCallback c = user_callback_;
228 user_callback_.Reset();
229 DVLOG(1) << "Finished setting up SOCKS handshake";
230 c.Run(result);
[email protected]3cd17242009-06-23 02:59:02231}
232
233void SOCKSClientSocket::OnIOComplete(int result) {
234 DCHECK_NE(STATE_NONE, next_state_);
235 int rv = DoLoop(result);
[email protected]5a05c47a2009-11-02 23:25:19236 if (rv != ERR_IO_PENDING) {
[email protected]d7fd1782011-02-08 19:16:43237 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv);
[email protected]3cd17242009-06-23 02:59:02238 DoCallback(rv);
[email protected]5a05c47a2009-11-02 23:25:19239 }
[email protected]3cd17242009-06-23 02:59:02240}
241
242int SOCKSClientSocket::DoLoop(int last_io_result) {
243 DCHECK_NE(next_state_, STATE_NONE);
244 int rv = last_io_result;
245 do {
246 State state = next_state_;
247 next_state_ = STATE_NONE;
248 switch (state) {
249 case STATE_RESOLVE_HOST:
250 DCHECK_EQ(OK, rv);
251 rv = DoResolveHost();
252 break;
253 case STATE_RESOLVE_HOST_COMPLETE:
254 rv = DoResolveHostComplete(rv);
255 break;
256 case STATE_HANDSHAKE_WRITE:
257 DCHECK_EQ(OK, rv);
258 rv = DoHandshakeWrite();
259 break;
260 case STATE_HANDSHAKE_WRITE_COMPLETE:
261 rv = DoHandshakeWriteComplete(rv);
262 break;
263 case STATE_HANDSHAKE_READ:
264 DCHECK_EQ(OK, rv);
265 rv = DoHandshakeRead();
266 break;
267 case STATE_HANDSHAKE_READ_COMPLETE:
268 rv = DoHandshakeReadComplete(rv);
269 break;
270 default:
271 NOTREACHED() << "bad state";
272 rv = ERR_UNEXPECTED;
273 break;
274 }
275 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
276 return rv;
277}
278
279int SOCKSClientSocket::DoResolveHost() {
[email protected]3cd17242009-06-23 02:59:02280 next_state_ = STATE_RESOLVE_HOST_COMPLETE;
[email protected]034d3892011-03-29 04:07:21281 // SOCKS4 only supports IPv4 addresses, so only try getting the IPv4
282 // addresses for the target host.
283 host_request_info_.set_address_family(ADDRESS_FAMILY_IPV4);
[email protected]ec08bb22009-08-12 00:25:12284 return host_resolver_.Resolve(
[email protected]aa22b242011-11-16 18:58:29285 host_request_info_, &addresses_,
286 base::Bind(&SOCKSClientSocket::OnIOComplete, base::Unretained(this)),
287 net_log_);
[email protected]3cd17242009-06-23 02:59:02288}
289
290int SOCKSClientSocket::DoResolveHostComplete(int result) {
[email protected]034d3892011-03-29 04:07:21291 if (result != OK) {
292 // Resolving the hostname failed; fail the request rather than automatically
293 // falling back to SOCKS4a (since it can be confusing to see invalid IP
294 // addresses being sent to the SOCKS4 server when it doesn't support 4A.)
295 return result;
[email protected]3cd17242009-06-23 02:59:02296 }
297
[email protected]034d3892011-03-29 04:07:21298 next_state_ = STATE_HANDSHAKE_WRITE;
[email protected]3cd17242009-06-23 02:59:02299 return OK;
300}
301
302// Builds the buffer that is to be sent to the server.
[email protected]76a51ac82009-06-28 07:58:58303const std::string SOCKSClientSocket::BuildHandshakeWriteBuffer() const {
[email protected]76a51ac82009-06-28 07:58:58304 SOCKS4ServerRequest request;
305 request.version = kSOCKSVersion4;
306 request.command = kSOCKSStreamRequest;
[email protected]9eb7b11b2012-03-28 20:19:31307 request.nw_port = base::HostToNet16(host_request_info_.port());
[email protected]3cd17242009-06-23 02:59:02308
[email protected]7054e78f2012-05-07 21:44:56309 DCHECK(!addresses_.empty());
310 const IPEndPoint& endpoint = addresses_.front();
[email protected]3cd17242009-06-23 02:59:02311
[email protected]034d3892011-03-29 04:07:21312 // We disabled IPv6 results when resolving the hostname, so none of the
313 // results in the list will be IPv6.
314 // TODO(eroman): we only ever use the first address in the list. It would be
315 // more robust to try all the IP addresses we have before
316 // failing the connect attempt.
[email protected]7054e78f2012-05-07 21:44:56317 CHECK_EQ(AF_INET, endpoint.GetFamily());
318 CHECK_LE(endpoint.address().size(), sizeof(request.ip));
319 memcpy(&request.ip, &endpoint.address()[0], endpoint.address().size());
[email protected]034d3892011-03-29 04:07:21320
[email protected]7054e78f2012-05-07 21:44:56321 DVLOG(1) << "Resolved Host is : " << endpoint.ToStringWithoutPort();
[email protected]3cd17242009-06-23 02:59:02322
[email protected]76a51ac82009-06-28 07:58:58323 std::string handshake_data(reinterpret_cast<char*>(&request),
324 sizeof(request));
325 handshake_data.append(kEmptyUserId, arraysize(kEmptyUserId));
[email protected]3cd17242009-06-23 02:59:02326
[email protected]76a51ac82009-06-28 07:58:58327 return handshake_data;
[email protected]3cd17242009-06-23 02:59:02328}
329
330// Writes the SOCKS handshake data to the underlying socket connection.
331int SOCKSClientSocket::DoHandshakeWrite() {
332 next_state_ = STATE_HANDSHAKE_WRITE_COMPLETE;
333
[email protected]76a51ac82009-06-28 07:58:58334 if (buffer_.empty()) {
335 buffer_ = BuildHandshakeWriteBuffer();
[email protected]3cd17242009-06-23 02:59:02336 bytes_sent_ = 0;
337 }
338
[email protected]76a51ac82009-06-28 07:58:58339 int handshake_buf_len = buffer_.size() - bytes_sent_;
340 DCHECK_GT(handshake_buf_len, 0);
341 handshake_buf_ = new IOBuffer(handshake_buf_len);
342 memcpy(handshake_buf_->data(), &buffer_[bytes_sent_],
343 handshake_buf_len);
[email protected]83039bb2011-12-09 18:43:55344 return transport_->socket()->Write(
345 handshake_buf_, handshake_buf_len,
346 base::Bind(&SOCKSClientSocket::OnIOComplete, base::Unretained(this)));
[email protected]3cd17242009-06-23 02:59:02347}
348
349int SOCKSClientSocket::DoHandshakeWriteComplete(int result) {
[email protected]3cd17242009-06-23 02:59:02350 if (result < 0)
351 return result;
352
[email protected]76a51ac82009-06-28 07:58:58353 // We ignore the case when result is 0, since the underlying Write
354 // may return spurious writes while waiting on the socket.
355
[email protected]3cd17242009-06-23 02:59:02356 bytes_sent_ += result;
[email protected]76a51ac82009-06-28 07:58:58357 if (bytes_sent_ == buffer_.size()) {
[email protected]3cd17242009-06-23 02:59:02358 next_state_ = STATE_HANDSHAKE_READ;
[email protected]76a51ac82009-06-28 07:58:58359 buffer_.clear();
360 } else if (bytes_sent_ < buffer_.size()) {
[email protected]3cd17242009-06-23 02:59:02361 next_state_ = STATE_HANDSHAKE_WRITE;
362 } else {
363 return ERR_UNEXPECTED;
364 }
365
366 return OK;
367}
368
369int SOCKSClientSocket::DoHandshakeRead() {
[email protected]3cd17242009-06-23 02:59:02370 next_state_ = STATE_HANDSHAKE_READ_COMPLETE;
371
[email protected]76a51ac82009-06-28 07:58:58372 if (buffer_.empty()) {
[email protected]3cd17242009-06-23 02:59:02373 bytes_received_ = 0;
374 }
375
[email protected]76a51ac82009-06-28 07:58:58376 int handshake_buf_len = kReadHeaderSize - bytes_received_;
377 handshake_buf_ = new IOBuffer(handshake_buf_len);
[email protected]a796bcec2010-03-22 17:17:26378 return transport_->socket()->Read(handshake_buf_, handshake_buf_len,
[email protected]83039bb2011-12-09 18:43:55379 base::Bind(&SOCKSClientSocket::OnIOComplete,
380 base::Unretained(this)));
[email protected]3cd17242009-06-23 02:59:02381}
382
383int SOCKSClientSocket::DoHandshakeReadComplete(int result) {
[email protected]3cd17242009-06-23 02:59:02384 if (result < 0)
385 return result;
[email protected]76a51ac82009-06-28 07:58:58386
387 // The underlying socket closed unexpectedly.
388 if (result == 0)
389 return ERR_CONNECTION_CLOSED;
390
[email protected]d5a309592010-02-05 02:22:52391 if (bytes_received_ + result > kReadHeaderSize) {
[email protected]9e743cd2010-03-16 07:03:53392 // TODO(eroman): Describe failure in NetLog.
[email protected]d5a309592010-02-05 02:22:52393 return ERR_SOCKS_CONNECTION_FAILED;
394 }
[email protected]3cd17242009-06-23 02:59:02395
[email protected]76a51ac82009-06-28 07:58:58396 buffer_.append(handshake_buf_->data(), result);
[email protected]3cd17242009-06-23 02:59:02397 bytes_received_ += result;
[email protected]76a51ac82009-06-28 07:58:58398 if (bytes_received_ < kReadHeaderSize) {
[email protected]3cd17242009-06-23 02:59:02399 next_state_ = STATE_HANDSHAKE_READ;
400 return OK;
401 }
402
[email protected]76a51ac82009-06-28 07:58:58403 const SOCKS4ServerResponse* response =
404 reinterpret_cast<const SOCKS4ServerResponse*>(buffer_.data());
[email protected]3cd17242009-06-23 02:59:02405
406 if (response->reserved_null != 0x00) {
407 LOG(ERROR) << "Unknown response from SOCKS server.";
[email protected]d5a309592010-02-05 02:22:52408 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02409 }
410
[email protected]3cd17242009-06-23 02:59:02411 switch (response->code) {
412 case kServerResponseOk:
413 completed_handshake_ = true;
414 return OK;
415 case kServerResponseRejected:
416 LOG(ERROR) << "SOCKS request rejected or failed";
[email protected]d5a309592010-02-05 02:22:52417 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02418 case kServerResponseNotReachable:
419 LOG(ERROR) << "SOCKS request failed because client is not running "
420 << "identd (or not reachable from the server)";
[email protected]d5a309592010-02-05 02:22:52421 return ERR_SOCKS_CONNECTION_HOST_UNREACHABLE;
[email protected]3cd17242009-06-23 02:59:02422 case kServerResponseMismatchedUserId:
423 LOG(ERROR) << "SOCKS request failed because client's identd could "
424 << "not confirm the user ID string in the request";
[email protected]d5a309592010-02-05 02:22:52425 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02426 default:
427 LOG(ERROR) << "SOCKS server sent unknown response";
[email protected]d5a309592010-02-05 02:22:52428 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02429 }
430
431 // Note: we ignore the last 6 bytes as specified by the SOCKS protocol
432}
433
[email protected]ac9eec62010-02-20 18:50:38434int SOCKSClientSocket::GetPeerAddress(AddressList* address) const {
[email protected]a796bcec2010-03-22 17:17:26435 return transport_->socket()->GetPeerAddress(address);
[email protected]3cd17242009-06-23 02:59:02436}
[email protected]3cd17242009-06-23 02:59:02437
[email protected]e7f74da2011-04-19 23:49:35438int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const {
439 return transport_->socket()->GetLocalAddress(address);
440}
441
[email protected]3cd17242009-06-23 02:59:02442} // namespace net