OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socket/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 DCHECK(transport_->socket()); | 91 DCHECK(transport_->socket()); |
92 DCHECK_EQ(STATE_NONE, next_state_); | 92 DCHECK_EQ(STATE_NONE, next_state_); |
93 DCHECK(user_callback_.is_null()); | 93 DCHECK(user_callback_.is_null()); |
94 | 94 |
95 // If already connected, then just return OK. | 95 // If already connected, then just return OK. |
96 if (completed_handshake_) | 96 if (completed_handshake_) |
97 return OK; | 97 return OK; |
98 | 98 |
99 next_state_ = STATE_RESOLVE_HOST; | 99 next_state_ = STATE_RESOLVE_HOST; |
100 | 100 |
101 net_log_.BeginEvent(NetLog::TYPE_SOCKS_CONNECT, NULL); | 101 net_log_.BeginEvent(NetLog::TYPE_SOCKS_CONNECT); |
102 | 102 |
103 int rv = DoLoop(OK); | 103 int rv = DoLoop(OK); |
104 if (rv == ERR_IO_PENDING) { | 104 if (rv == ERR_IO_PENDING) { |
105 user_callback_ = callback; | 105 user_callback_ = callback; |
106 } else { | 106 } else { |
107 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv); | 107 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv); |
108 } | 108 } |
109 return rv; | 109 return rv; |
110 } | 110 } |
111 | 111 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { | 434 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { |
435 return transport_->socket()->GetPeerAddress(address); | 435 return transport_->socket()->GetPeerAddress(address); |
436 } | 436 } |
437 | 437 |
438 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 438 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
439 return transport_->socket()->GetLocalAddress(address); | 439 return transport_->socket()->GetLocalAddress(address); |
440 } | 440 } |
441 | 441 |
442 } // namespace net | 442 } // namespace net |
OLD | NEW |