| 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 #ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 static const unsigned int kGreetReadHeaderSize; | 93 static const unsigned int kGreetReadHeaderSize; |
| 94 static const unsigned int kWriteHeaderSize; | 94 static const unsigned int kWriteHeaderSize; |
| 95 static const unsigned int kReadHeaderSize; | 95 static const unsigned int kReadHeaderSize; |
| 96 static const uint8 kSOCKS5Version; | 96 static const uint8 kSOCKS5Version; |
| 97 static const uint8 kTunnelCommand; | 97 static const uint8 kTunnelCommand; |
| 98 static const uint8 kNullByte; | 98 static const uint8 kNullByte; |
| 99 | 99 |
| 100 void DoCallback(int result); | 100 void DoCallback(int result); |
| 101 void OnIOComplete(int result); | 101 void OnIOComplete(int result); |
| 102 void OnReadWriteComplete(const CompletionCallback& callback, int result); |
| 102 | 103 |
| 103 int DoLoop(int last_io_result); | 104 int DoLoop(int last_io_result); |
| 104 int DoHandshakeRead(); | 105 int DoHandshakeRead(); |
| 105 int DoHandshakeReadComplete(int result); | 106 int DoHandshakeReadComplete(int result); |
| 106 int DoHandshakeWrite(); | 107 int DoHandshakeWrite(); |
| 107 int DoHandshakeWriteComplete(int result); | 108 int DoHandshakeWriteComplete(int result); |
| 108 int DoGreetRead(); | 109 int DoGreetRead(); |
| 109 int DoGreetReadComplete(int result); | 110 int DoGreetReadComplete(int result); |
| 110 int DoGreetWrite(); | 111 int DoGreetWrite(); |
| 111 int DoGreetWriteComplete(int result); | 112 int DoGreetWriteComplete(int result); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 136 // This becomes true when the SOCKS handshake has completed and the | 137 // This becomes true when the SOCKS handshake has completed and the |
| 137 // overlying connection is free to communicate. | 138 // overlying connection is free to communicate. |
| 138 bool completed_handshake_; | 139 bool completed_handshake_; |
| 139 | 140 |
| 140 // These contain the bytes sent / received by the SOCKS handshake. | 141 // These contain the bytes sent / received by the SOCKS handshake. |
| 141 size_t bytes_sent_; | 142 size_t bytes_sent_; |
| 142 size_t bytes_received_; | 143 size_t bytes_received_; |
| 143 | 144 |
| 144 size_t read_header_size; | 145 size_t read_header_size; |
| 145 | 146 |
| 147 bool was_used_to_convey_data_; |
| 148 |
| 146 HostResolver::RequestInfo host_request_info_; | 149 HostResolver::RequestInfo host_request_info_; |
| 147 | 150 |
| 148 BoundNetLog net_log_; | 151 BoundNetLog net_log_; |
| 149 | 152 |
| 150 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); | 153 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); |
| 151 }; | 154 }; |
| 152 | 155 |
| 153 } // namespace net | 156 } // namespace net |
| 154 | 157 |
| 155 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 158 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| OLD | NEW |