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_FTP_FTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 STATE_DATA_CONNECT, | 118 STATE_DATA_CONNECT, |
119 STATE_DATA_CONNECT_COMPLETE, | 119 STATE_DATA_CONNECT_COMPLETE, |
120 STATE_DATA_READ, | 120 STATE_DATA_READ, |
121 STATE_DATA_READ_COMPLETE, | 121 STATE_DATA_READ_COMPLETE, |
122 STATE_NONE | 122 STATE_NONE |
123 }; | 123 }; |
124 | 124 |
125 // Resets the members of the transaction so it can be restarted. | 125 // Resets the members of the transaction so it can be restarted. |
126 void ResetStateForRestart(); | 126 void ResetStateForRestart(); |
127 | 127 |
| 128 // Resets the data connection after an error and switches to |next_state|. |
| 129 void ResetDataConnectionAfterError(State next_state); |
| 130 |
128 void DoCallback(int result); | 131 void DoCallback(int result); |
129 void OnIOComplete(int result); | 132 void OnIOComplete(int result); |
130 | 133 |
131 // Executes correct ProcessResponse + command_name function based on last | 134 // Executes correct ProcessResponse + command_name function based on last |
132 // issued command. Returns error code. | 135 // issued command. Returns error code. |
133 int ProcessCtrlResponse(); | 136 int ProcessCtrlResponse(); |
134 | 137 |
135 int SendFtpCommand(const std::string& command, | 138 int SendFtpCommand(const std::string& command, |
136 const std::string& command_for_log, | 139 const std::string& command_for_log, |
137 Command cmd); | 140 Command cmd); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 std::string current_remote_directory_; | 245 std::string current_remote_directory_; |
243 | 246 |
244 int data_connection_port_; | 247 int data_connection_port_; |
245 | 248 |
246 ClientSocketFactory* socket_factory_; | 249 ClientSocketFactory* socket_factory_; |
247 | 250 |
248 scoped_ptr<StreamSocket> ctrl_socket_; | 251 scoped_ptr<StreamSocket> ctrl_socket_; |
249 scoped_ptr<StreamSocket> data_socket_; | 252 scoped_ptr<StreamSocket> data_socket_; |
250 | 253 |
251 State next_state_; | 254 State next_state_; |
| 255 |
| 256 // State to switch to after data connection is complete. |
| 257 State state_after_data_connect_complete_; |
252 }; | 258 }; |
253 | 259 |
254 } // namespace net | 260 } // namespace net |
255 | 261 |
256 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 262 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |