summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 03:22:42 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 03:22:42 +0000
commit5723cd738b7a3aeabaa5b53d276205275e6b5ff0 (patch)
tree66312f964ef2748faa789a537a88a110b089b104 /net
parent15aea41a83a90ab5a5711979c664d5c97f0d1945 (diff)
downloadchromium_src-5723cd738b7a3aeabaa5b53d276205275e6b5ff0.zip
chromium_src-5723cd738b7a3aeabaa5b53d276205275e6b5ff0.tar.gz
chromium_src-5723cd738b7a3aeabaa5b53d276205275e6b5ff0.tar.bz2
Minor clean-up for HttpStreamParser::DoSendBody()
This shouldn't change the behavior, as chunk_lengths_ is guaranteed to be zero at the two places, as wtc pointed out. BUG=72001 TEST=run tests. Review URL: http://codereview.chromium.org/9232032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_stream_parser.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 5277780..bd9bda1 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -348,7 +348,6 @@ int HttpStreamParser::DoSendBody(int result) {
// called, hence the first call to MarkConsumedAndFillBuffer() is a noop.
request_body_->MarkConsumedAndFillBuffer(chunk_length_without_encoding_);
chunk_length_without_encoding_ = 0;
- chunk_length_ = 0;
int buf_len = static_cast<int>(request_body_->buf_len());
if (request_body_->eof()) {
@@ -367,10 +366,10 @@ int HttpStreamParser::DoSendBody(int result) {
memcpy(chunk_ptr, "\r\n", 2);
chunk_length_without_encoding_ = buf_len;
chunk_length_ = chunk_header.length() + buf_len + 2;
- }
-
- if (!chunk_length_) // chunk_buf_ is empty. More POST data is yet to come?
+ } else {
+ // Nothing to send. More POST data is yet to come?
return ERR_IO_PENDING;
+ }
return connection_->socket()->Write(chunk_buf_, chunk_length_,
io_callback_);