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

Unified Diff: net/ftp/ftp_directory_listing_parsers.h

Issue 421006: Fix recognizing FTP listings consisting of only one line. (Closed)
Patch Set: Created 11 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 | « net/ftp/ftp_directory_listing_buffer_unittest.cc ('k') | net/ftp/ftp_directory_listing_parsers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parsers.h
diff --git a/net/ftp/ftp_directory_listing_parsers.h b/net/ftp/ftp_directory_listing_parsers.h
index e02bb1d8f631bff8a9d34147380e6b8d64183aa6..8b11ecb0837b9c51059dad1d0f51d29c2695f4a7 100644
--- a/net/ftp/ftp_directory_listing_parsers.h
+++ b/net/ftp/ftp_directory_listing_parsers.h
@@ -38,6 +38,10 @@ class FtpDirectoryListingParser {
// Adds |line| to the internal parsing buffer. Returns true on success.
virtual bool ConsumeLine(const string16& line) = 0;
+ // Called after all input has been consumed. Returns true if the parser
+ // recognizes all received data as a valid listing.
+ virtual bool OnEndOfInput() = 0;
+
// Returns true if there is at least one FtpDirectoryListingEntry available.
virtual bool EntryAvailable() const = 0;
@@ -54,6 +58,7 @@ class FtpLsDirectoryListingParser : public FtpDirectoryListingParser {
// FtpDirectoryListingParser methods:
virtual FtpServerType GetServerType() const { return SERVER_LS; }
virtual bool ConsumeLine(const string16& line);
+ virtual bool OnEndOfInput();
virtual bool EntryAvailable() const;
virtual FtpDirectoryListingEntry PopEntry();
@@ -72,6 +77,7 @@ class FtpWindowsDirectoryListingParser : public FtpDirectoryListingParser {
// FtpDirectoryListingParser methods:
virtual FtpServerType GetServerType() const { return SERVER_WINDOWS; }
virtual bool ConsumeLine(const string16& line);
+ virtual bool OnEndOfInput();
virtual bool EntryAvailable() const;
virtual FtpDirectoryListingEntry PopEntry();
@@ -89,6 +95,7 @@ class FtpVmsDirectoryListingParser : public FtpDirectoryListingParser {
// FtpDirectoryListingParser methods:
virtual FtpServerType GetServerType() const { return SERVER_VMS; }
virtual bool ConsumeLine(const string16& line);
+ virtual bool OnEndOfInput();
virtual bool EntryAvailable() const;
virtual FtpDirectoryListingEntry PopEntry();
« no previous file with comments | « net/ftp/ftp_directory_listing_buffer_unittest.cc ('k') | net/ftp/ftp_directory_listing_parsers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698