| 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/socks5_client_socket.h" | 5 #include "net/socket/socks5_client_socket.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 NOTREACHED(); | 137 NOTREACHED(); |
| 138 return kProtoUnknown; | 138 return kProtoUnknown; |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool SOCKS5ClientSocket::GetSSLInfo(SSLInfo* ssl_info) { | 141 bool SOCKS5ClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 142 if (transport_.get() && transport_->socket()) { | 142 if (transport_.get() && transport_->socket()) { |
| 143 return transport_->socket()->GetSSLInfo(ssl_info); | 143 return transport_->socket()->GetSSLInfo(ssl_info); |
| 144 } | 144 } |
| 145 NOTREACHED(); | 145 NOTREACHED(); |
| 146 return false; | 146 return false; |
| 147 } |
| 147 | 148 |
| 149 void SOCKS5ClientSocket::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 150 out->clear(); |
| 148 } | 151 } |
| 149 | 152 |
| 150 // Read is called by the transport layer above to read. This can only be done | 153 // Read is called by the transport layer above to read. This can only be done |
| 151 // if the SOCKS handshake is complete. | 154 // if the SOCKS handshake is complete. |
| 152 int SOCKS5ClientSocket::Read(IOBuffer* buf, int buf_len, | 155 int SOCKS5ClientSocket::Read(IOBuffer* buf, int buf_len, |
| 153 const CompletionCallback& callback) { | 156 const CompletionCallback& callback) { |
| 154 DCHECK(completed_handshake_); | 157 DCHECK(completed_handshake_); |
| 155 DCHECK_EQ(STATE_NONE, next_state_); | 158 DCHECK_EQ(STATE_NONE, next_state_); |
| 156 DCHECK(user_callback_.is_null()); | 159 DCHECK(user_callback_.is_null()); |
| 157 DCHECK(!callback.is_null()); | 160 DCHECK(!callback.is_null()); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 500 |
| 498 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { | 501 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 499 return transport_->socket()->GetPeerAddress(address); | 502 return transport_->socket()->GetPeerAddress(address); |
| 500 } | 503 } |
| 501 | 504 |
| 502 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { | 505 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 503 return transport_->socket()->GetLocalAddress(address); | 506 return transport_->socket()->GetLocalAddress(address); |
| 504 } | 507 } |
| 505 | 508 |
| 506 } // namespace net | 509 } // namespace net |
| OLD | NEW |