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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 struct SOCKS4ServerResponse { | 50 struct SOCKS4ServerResponse { |
51 uint8_t reserved_null; | 51 uint8_t reserved_null; |
52 uint8_t code; | 52 uint8_t code; |
53 uint16_t port; | 53 uint16_t port; |
54 uint8_t ip[4]; | 54 uint8_t ip[4]; |
55 }; | 55 }; |
56 static_assert(sizeof(SOCKS4ServerResponse) == kReadHeaderSize, | 56 static_assert(sizeof(SOCKS4ServerResponse) == kReadHeaderSize, |
57 "socks4 server response struct has incorrect size"); | 57 "socks4 server response struct has incorrect size"); |
58 | 58 |
59 SOCKSClientSocket::SOCKSClientSocket( | 59 SOCKSClientSocket::SOCKSClientSocket( |
60 scoped_ptr<ClientSocketHandle> transport_socket, | 60 std::unique_ptr<ClientSocketHandle> transport_socket, |
61 const HostResolver::RequestInfo& req_info, | 61 const HostResolver::RequestInfo& req_info, |
62 RequestPriority priority, | 62 RequestPriority priority, |
63 HostResolver* host_resolver) | 63 HostResolver* host_resolver) |
64 : transport_(std::move(transport_socket)), | 64 : transport_(std::move(transport_socket)), |
65 next_state_(STATE_NONE), | 65 next_state_(STATE_NONE), |
66 completed_handshake_(false), | 66 completed_handshake_(false), |
67 bytes_sent_(0), | 67 bytes_sent_(0), |
68 bytes_received_(0), | 68 bytes_received_(0), |
69 was_ever_used_(false), | 69 was_ever_used_(false), |
70 host_resolver_(host_resolver), | 70 host_resolver_(host_resolver), |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { | 447 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { |
448 return transport_->socket()->GetPeerAddress(address); | 448 return transport_->socket()->GetPeerAddress(address); |
449 } | 449 } |
450 | 450 |
451 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 451 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
452 return transport_->socket()->GetLocalAddress(address); | 452 return transport_->socket()->GetLocalAddress(address); |
453 } | 453 } |
454 | 454 |
455 } // namespace net | 455 } // namespace net |
OLD | NEW |