summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_ctrl_response_buffer.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 20:50:48 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 20:50:48 +0000
commit1c9735aa8747af43bddbe8c785af05f0d55538b1 (patch)
treebd5da102813cb974f52f6aaa0cf13519c996feaf /net/ftp/ftp_ctrl_response_buffer.h
parent1ccab1dde4b84910e5d42461ee1cd5004be06eff (diff)
downloadchromium_src-1c9735aa8747af43bddbe8c785af05f0d55538b1.zip
chromium_src-1c9735aa8747af43bddbe8c785af05f0d55538b1.tar.gz
chromium_src-1c9735aa8747af43bddbe8c785af05f0d55538b1.tar.bz2
net/ftp: Fix control response parsing for a corner cases where the first line of a continuation has 0 length.
BUG=29322 TEST=ftp://sourceware.org works. Review URL: http://codereview.chromium.org/467032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_ctrl_response_buffer.h')
-rw-r--r--net/ftp/ftp_ctrl_response_buffer.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ftp/ftp_ctrl_response_buffer.h b/net/ftp/ftp_ctrl_response_buffer.h
index 66aae8b..6ea34cb 100644
--- a/net/ftp/ftp_ctrl_response_buffer.h
+++ b/net/ftp/ftp_ctrl_response_buffer.h
@@ -24,7 +24,8 @@ struct FtpCtrlResponse {
class FtpCtrlResponseBuffer {
public:
- FtpCtrlResponseBuffer() {}
+ FtpCtrlResponseBuffer() : multiline_(false) {
+ }
// Called when data is received from the control socket. Returns error code.
int ConsumeData(const char* data, int data_length);
@@ -81,6 +82,9 @@ class FtpCtrlResponseBuffer {
std::queue<ParsedLine> lines_;
+ // True if we are in the middle of parsing a multi-line response.
+ bool multiline_;
+
// When parsing a multiline response, we don't know beforehand if a line
// will have a continuation. So always store last line of multiline response
// so we can append the continuation to it.