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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls.cc

Issue 8970023: FTP: work around server bugs resulting in negative file size being sent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « net/base/net_util.cc ('k') | net/ftp/ftp_directory_listing_parser_ls_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parser_ls.cc
===================================================================
--- net/ftp/ftp_directory_listing_parser_ls.cc (revision 114696)
+++ net/ftp/ftp_directory_listing_parser_ls.cc (working copy)
@@ -187,8 +187,13 @@
// TODO(phajdan.jr): Use a value that means "unknown" instead of 0 bytes.
entry.size = 0;
}
- if (entry.size < 0)
- return false;
+ if (entry.size < 0) {
+ // Some FTP servers have bugs that cause them to display the file size
+ // as negative. They're most likely big files like DVD ISO images.
+ // We still want to display them, so just say the real file size
+ // is unknown.
+ entry.size = -1;
+ }
if (entry.type != FtpDirectoryListingEntry::FILE)
entry.size = -1;
« no previous file with comments | « net/base/net_util.cc ('k') | net/ftp/ftp_directory_listing_parser_ls_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698