Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1535)

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 5669001: FTP: fix compatibility problems with MLSD by removing MLSD support. (Closed)
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index bfda5bd066a4b1047aeb54f75a4d57ff4104500f..0285e08acfeed7c643d62a36e82162a2277bf01c 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -371,9 +371,6 @@ int FtpNetworkTransaction::ProcessCtrlResponse() {
case COMMAND_CWD:
rv = ProcessResponseCWD(response);
break;
- case COMMAND_MLSD:
- rv = ProcessResponseMLSD(response);
- break;
case COMMAND_LIST:
rv = ProcessResponseLIST(response);
break;
@@ -394,9 +391,6 @@ int FtpNetworkTransaction::ProcessCtrlResponse() {
case COMMAND_RETR:
rv = ProcessResponseRETR(response);
break;
- case COMMAND_MLSD:
- rv = ProcessResponseMLSD(response);
- break;
case COMMAND_LIST:
rv = ProcessResponseLIST(response);
break;
@@ -573,10 +567,6 @@ int FtpNetworkTransaction::DoLoop(int result) {
DCHECK(rv == OK);
rv = DoCtrlWriteCWD();
break;
- case STATE_CTRL_WRITE_MLSD:
- DCHECK(rv == 0);
- rv = DoCtrlWriteMLSD();
- break;
case STATE_CTRL_WRITE_LIST:
DCHECK(rv == OK);
rv = DoCtrlWriteLIST();
@@ -1073,7 +1063,7 @@ int FtpNetworkTransaction::ProcessResponseCWD(const FtpCtrlResponse& response) {
case ERROR_CLASS_INITIATED:
return Stop(ERR_INVALID_RESPONSE);
case ERROR_CLASS_OK:
- next_state_ = STATE_CTRL_WRITE_MLSD;
+ next_state_ = STATE_CTRL_WRITE_LIST;
break;
case ERROR_CLASS_INFO_NEEDED:
return Stop(ERR_INVALID_RESPONSE);
@@ -1104,41 +1094,6 @@ int FtpNetworkTransaction::ProcessResponseCWD(const FtpCtrlResponse& response) {
return OK;
}
-// MLSD command
-int FtpNetworkTransaction::DoCtrlWriteMLSD() {
- next_state_ = STATE_CTRL_READ;
- return SendFtpCommand("MLSD", COMMAND_MLSD);
-}
-
-int FtpNetworkTransaction::ProcessResponseMLSD(
- const FtpCtrlResponse& response) {
- switch (GetErrorClass(response.status_code)) {
- case ERROR_CLASS_INITIATED:
- // We want the client to start reading the response at this point.
- // It got here either through Start or RestartWithAuth. We want that
- // method to complete. Not setting next state here will make DoLoop exit
- // and in turn make Start/RestartWithAuth complete.
- response_.is_directory_listing = true;
- break;
- case ERROR_CLASS_OK:
- response_.is_directory_listing = true;
- next_state_ = STATE_CTRL_WRITE_QUIT;
- break;
- case ERROR_CLASS_INFO_NEEDED:
- return Stop(ERR_INVALID_RESPONSE);
- case ERROR_CLASS_TRANSIENT_ERROR:
- case ERROR_CLASS_PERMANENT_ERROR:
- // Fallback to the LIST command, more widely supported,
- // but without a specified output format.
- next_state_ = STATE_CTRL_WRITE_LIST;
- break;
- default:
- NOTREACHED();
- return Stop(ERR_UNEXPECTED);
- }
- return OK;
-}
-
// LIST command
int FtpNetworkTransaction::DoCtrlWriteLIST() {
std::string command(system_type_ == SYSTEM_TYPE_VMS ? "LIST *.*;0" : "LIST");

Powered by Google App Engine
This is Rietveld 408576698