summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_network_transaction.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-18 18:32:45 +0000
committerBen Murdoch <benm@google.com>2010-11-18 18:38:07 +0000
commit513209b27ff55e2841eac0e4120199c23acce758 (patch)
treeaeba30bb08c5f47c57003544e378a377c297eee6 /net/ftp/ftp_network_transaction.cc
parent164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff)
downloadexternal_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
Diffstat (limited to 'net/ftp/ftp_network_transaction.cc')
-rw-r--r--net/ftp/ftp_network_transaction.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 02e4be0..bc1c2a9 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -977,8 +977,14 @@ int FtpNetworkTransaction::ProcessResponseSIZE(
return Stop(ERR_INVALID_RESPONSE);
if (size < 0)
return Stop(ERR_INVALID_RESPONSE);
- response_.expected_content_size = size;
- resource_type_ = RESOURCE_TYPE_FILE;
+
+ // Some FTP servers respond with success to the SIZE command
+ // for directories, and return 0 size. Make sure we don't set
+ // the resource type to file if that's the case.
+ if (size > 0) {
+ response_.expected_content_size = size;
+ resource_type_ = RESOURCE_TYPE_FILE;
+ }
break;
case ERROR_CLASS_INFO_NEEDED:
break;
@@ -1298,6 +1304,7 @@ void FtpNetworkTransaction::RecordDataConnectionError(int result) {
type = NET_ERROR_OK;
break;
case ERR_ACCESS_DENIED:
+ case ERR_NETWORK_ACCESS_DENIED:
type = NET_ERROR_ACCESS_DENIED;
break;
case ERR_TIMED_OUT: