OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // 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 <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 COMMAND_SYST, | 54 COMMAND_SYST, |
55 COMMAND_TYPE, | 55 COMMAND_TYPE, |
56 COMMAND_EPSV, | 56 COMMAND_EPSV, |
57 COMMAND_PASV, | 57 COMMAND_PASV, |
58 COMMAND_PWD, | 58 COMMAND_PWD, |
59 COMMAND_SIZE, | 59 COMMAND_SIZE, |
60 COMMAND_RETR, | 60 COMMAND_RETR, |
61 COMMAND_CWD, | 61 COMMAND_CWD, |
62 COMMAND_MLSD, | 62 COMMAND_MLSD, |
63 COMMAND_LIST, | 63 COMMAND_LIST, |
64 COMMAND_MDTM, | |
65 COMMAND_QUIT, | 64 COMMAND_QUIT, |
66 }; | 65 }; |
67 | 66 |
68 enum ErrorClass { | 67 enum ErrorClass { |
69 // The requested action was initiated. The client should expect another | 68 // The requested action was initiated. The client should expect another |
70 // reply before issuing the next command. | 69 // reply before issuing the next command. |
71 ERROR_CLASS_INITIATED, | 70 ERROR_CLASS_INITIATED, |
72 | 71 |
73 // The requested action has been successfully completed. | 72 // The requested action has been successfully completed. |
74 ERROR_CLASS_OK, | 73 ERROR_CLASS_OK, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 int DoCtrlWriteRETR(); | 171 int DoCtrlWriteRETR(); |
173 int ProcessResponseRETR(const FtpCtrlResponse& response); | 172 int ProcessResponseRETR(const FtpCtrlResponse& response); |
174 int DoCtrlWriteSIZE(); | 173 int DoCtrlWriteSIZE(); |
175 int ProcessResponseSIZE(const FtpCtrlResponse& response); | 174 int ProcessResponseSIZE(const FtpCtrlResponse& response); |
176 int DoCtrlWriteCWD(); | 175 int DoCtrlWriteCWD(); |
177 int ProcessResponseCWD(const FtpCtrlResponse& response); | 176 int ProcessResponseCWD(const FtpCtrlResponse& response); |
178 int DoCtrlWriteMLSD(); | 177 int DoCtrlWriteMLSD(); |
179 int ProcessResponseMLSD(const FtpCtrlResponse& response); | 178 int ProcessResponseMLSD(const FtpCtrlResponse& response); |
180 int DoCtrlWriteLIST(); | 179 int DoCtrlWriteLIST(); |
181 int ProcessResponseLIST(const FtpCtrlResponse& response); | 180 int ProcessResponseLIST(const FtpCtrlResponse& response); |
182 int DoCtrlWriteMDTM(); | |
183 int ProcessResponseMDTM(const FtpCtrlResponse& response); | |
184 int DoCtrlWriteQUIT(); | 181 int DoCtrlWriteQUIT(); |
185 int ProcessResponseQUIT(const FtpCtrlResponse& response); | 182 int ProcessResponseQUIT(const FtpCtrlResponse& response); |
186 | 183 |
187 int DoDataConnect(); | 184 int DoDataConnect(); |
188 int DoDataConnectComplete(int result); | 185 int DoDataConnectComplete(int result); |
189 int DoDataRead(); | 186 int DoDataRead(); |
190 int DoDataReadComplete(int result); | 187 int DoDataReadComplete(int result); |
191 | 188 |
192 void RecordDataConnectionError(int result); | 189 void RecordDataConnectionError(int result); |
193 | 190 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 STATE_CTRL_WRITE_SYST, | 266 STATE_CTRL_WRITE_SYST, |
270 STATE_CTRL_WRITE_TYPE, | 267 STATE_CTRL_WRITE_TYPE, |
271 STATE_CTRL_WRITE_EPSV, | 268 STATE_CTRL_WRITE_EPSV, |
272 STATE_CTRL_WRITE_PASV, | 269 STATE_CTRL_WRITE_PASV, |
273 STATE_CTRL_WRITE_PWD, | 270 STATE_CTRL_WRITE_PWD, |
274 STATE_CTRL_WRITE_RETR, | 271 STATE_CTRL_WRITE_RETR, |
275 STATE_CTRL_WRITE_SIZE, | 272 STATE_CTRL_WRITE_SIZE, |
276 STATE_CTRL_WRITE_CWD, | 273 STATE_CTRL_WRITE_CWD, |
277 STATE_CTRL_WRITE_MLSD, | 274 STATE_CTRL_WRITE_MLSD, |
278 STATE_CTRL_WRITE_LIST, | 275 STATE_CTRL_WRITE_LIST, |
279 STATE_CTRL_WRITE_MDTM, | |
280 STATE_CTRL_WRITE_QUIT, | 276 STATE_CTRL_WRITE_QUIT, |
281 // Data connection states: | 277 // Data connection states: |
282 STATE_DATA_CONNECT, | 278 STATE_DATA_CONNECT, |
283 STATE_DATA_CONNECT_COMPLETE, | 279 STATE_DATA_CONNECT_COMPLETE, |
284 STATE_DATA_READ, | 280 STATE_DATA_READ, |
285 STATE_DATA_READ_COMPLETE, | 281 STATE_DATA_READ_COMPLETE, |
286 STATE_NONE | 282 STATE_NONE |
287 }; | 283 }; |
288 State next_state_; | 284 State next_state_; |
289 }; | 285 }; |
290 | 286 |
291 } // namespace net | 287 } // namespace net |
292 | 288 |
293 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 289 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |