diff options
Diffstat (limited to 'net/ftp/ftp_network_transaction.cc')
-rw-r--r-- | net/ftp/ftp_network_transaction.cc | 11 |
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: |