summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 23:23:29 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 23:23:29 +0000
commit19441957dacf04b6e66b03beb77023924a8fd4e1 (patch)
treef671061cdb01adf34246f70bdb136d8a28df8c77 /net
parentc0a9259d6a5f8bd534b01923b2d33a1ebe853f30 (diff)
downloadchromium_src-19441957dacf04b6e66b03beb77023924a8fd4e1.zip
chromium_src-19441957dacf04b6e66b03beb77023924a8fd4e1.tar.gz
chromium_src-19441957dacf04b6e66b03beb77023924a8fd4e1.tar.bz2
Improve error reporting for FTP passive connection failures.
Allocate the -6xx block to FTP errors. R=phajdan.jr BUG=32945 TEST=None Review URL: http://codereview.chromium.org/650006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39510 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_error_list.h5
-rw-r--r--net/ftp/ftp_network_transaction.cc4
-rw-r--r--net/ftp/ftp_network_transaction_unittest.cc6
3 files changed, 10 insertions, 5 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index ab777e6..e544897 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -11,6 +11,8 @@
// 200-299 Certificate errors
// 300-399 HTTP errors
// 400-499 Cache errors
+// 500-599 ?
+// 600-699 FTP errors
//
// An asynchronous IO operation is not yet complete. This usually does not
@@ -337,3 +339,6 @@ NET_ERROR(CACHE_RACE, -406)
// The server's response was insecure (e.g. there was a cert error).
NET_ERROR(INSECURE_RESPONSE, -501)
+//
+// The FTP PASV command failed.
+NET_ERROR(FTP_PASV_COMMAND_FAILED, -600)
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index dd8d219..2bfbda0 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -865,9 +865,9 @@ int FtpNetworkTransaction::ProcessResponsePASV(
case ERROR_CLASS_INFO_NEEDED:
return Stop(ERR_INVALID_RESPONSE);
case ERROR_CLASS_TRANSIENT_ERROR:
- return Stop(ERR_FAILED);
+ return Stop(ERR_FTP_PASV_COMMAND_FAILED);
case ERROR_CLASS_PERMANENT_ERROR:
- return Stop(ERR_FAILED);
+ return Stop(ERR_FTP_PASV_COMMAND_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 0c3e72c..d9be57c 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -1010,7 +1010,7 @@ TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailPasv) {
FtpSocketDataProvider::PRE_PASV,
FtpSocketDataProvider::PRE_QUIT,
"500 failed pasv\r\n",
- ERR_FAILED);
+ ERR_FTP_PASV_COMMAND_FAILED);
}
TEST_F(FtpNetworkTransactionTest, DirectoryTransactionMalformedMdtm) {
@@ -1040,7 +1040,7 @@ TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailPasv2) {
FtpSocketDataProvider::PRE_PASV2,
FtpSocketDataProvider::PRE_QUIT,
"500 failed pasv2\r\n",
- ERR_FAILED);
+ ERR_FTP_PASV_COMMAND_FAILED);
}
TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailCwd) {
@@ -1140,7 +1140,7 @@ TEST_F(FtpNetworkTransactionTest, DownloadTransactionFailPasv) {
FtpSocketDataProvider::PRE_PASV,
FtpSocketDataProvider::PRE_QUIT,
"500 failed pasv\r\n",
- ERR_FAILED);
+ ERR_FTP_PASV_COMMAND_FAILED);
}
TEST_F(FtpNetworkTransactionTest, DownloadTransactionFailMdtm) {