diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ftp/ftp_network_transaction.cc | 17 | ||||
-rw-r--r-- | net/ftp/ftp_network_transaction_unittest.cc | 11 |
2 files changed, 15 insertions, 13 deletions
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc index c939455..70ebde1 100644 --- a/net/ftp/ftp_network_transaction.cc +++ b/net/ftp/ftp_network_transaction.cc @@ -706,10 +706,9 @@ int FtpNetworkTransaction::ProcessResponseUSER( next_state_ = STATE_CTRL_WRITE_PASS; break; case ERROR_CLASS_TRANSIENT_ERROR: - if (response.status_code == 421) - return Stop(ERR_FAILED); - break; + return Stop(ERR_FAILED); case ERROR_CLASS_PERMANENT_ERROR: + response_.needs_auth = true; return Stop(ERR_FAILED); default: NOTREACHED(); @@ -739,18 +738,10 @@ int FtpNetworkTransaction::ProcessResponsePASS( next_state_ = STATE_CTRL_WRITE_ACCT; break; case ERROR_CLASS_TRANSIENT_ERROR: - if (response.status_code == 421) { - // TODO(ibrar): Retry here. - } return Stop(ERR_FAILED); case ERROR_CLASS_PERMANENT_ERROR: - if (response.status_code == 503) { - next_state_ = STATE_CTRL_WRITE_USER; - } else { - response_.needs_auth = true; - return Stop(ERR_FAILED); - } - break; + response_.needs_auth = true; + return Stop(ERR_FAILED); default: NOTREACHED(); return Stop(ERR_UNEXPECTED); diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc index 6b359a5..1a5ed53 100644 --- a/net/ftp/ftp_network_transaction_unittest.cc +++ b/net/ftp/ftp_network_transaction_unittest.cc @@ -1209,6 +1209,17 @@ TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailPass) { ERR_FAILED); } +// Regression test for http://crbug.com/38707. +TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailPass503) { + FtpSocketDataProviderDirectoryListing ctrl_socket; + TransactionFailHelper(&ctrl_socket, + "ftp://host", + FtpSocketDataProvider::PRE_PASSWD, + FtpSocketDataProvider::PRE_QUIT, + "503 Bad sequence of commands\r\n", + ERR_FAILED); +} + TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailSyst) { FtpSocketDataProviderDirectoryListing ctrl_socket; TransactionFailHelper(&ctrl_socket, |