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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 5227004: FTP: a successful response to SIZE does not mean the resource is a file. (Closed)
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index bc1c2a9af1eae4c02dc3494d380b4dd0368e8cf8..bfda5bd066a4b1047aeb54f75a4d57ff4104500f 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -978,13 +978,10 @@ int FtpNetworkTransaction::ProcessResponseSIZE(
if (size < 0)
return Stop(ERR_INVALID_RESPONSE);
- // 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;
- }
+ // A successful response to SIZE does not mean the resource is a file.
+ // Some FTP servers (for example, the qnx one) send a SIZE even for
+ // directories.
+ response_.expected_content_size = size;
break;
case ERROR_CLASS_INFO_NEEDED:
break;
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698