summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 16:52:00 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 16:52:00 +0000
commit1a151fb5f0a18cbf30005400ff1fe872915f8c8d (patch)
tree6c794981aaece762b9f92f008003291541ca6390 /net/http
parent96179e1ac9fc77b78b0d25d16893eb146d1a1848 (diff)
downloadchromium_src-1a151fb5f0a18cbf30005400ff1fe872915f8c8d.zip
chromium_src-1a151fb5f0a18cbf30005400ff1fe872915f8c8d.tar.gz
chromium_src-1a151fb5f0a18cbf30005400ff1fe872915f8c8d.tar.bz2
After r12485, every POST request has an UploadData, even if
no data needs to be uploaded, so that we can set the identifier field in UploadData. So we should now enter the STATE_WRITE_BODY state only if request_body_stream_ has a nonzero size, so that we won't call connection_.socket()->Write() with zero bytes. R=darin BUG=9347 Review URL: http://codereview.chromium.org/42681 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 77a5e19..5d92bc3 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -675,7 +675,8 @@ int HttpNetworkTransaction::DoWriteHeadersComplete(int result) {
request_headers_bytes_sent_ += result;
if (request_headers_bytes_sent_ < request_headers_.size()) {
next_state_ = STATE_WRITE_HEADERS;
- } else if (!establishing_tunnel_ && request_->upload_data) {
+ } else if (!establishing_tunnel_ && request_body_stream_.get() &&
+ request_body_stream_->size()) {
next_state_ = STATE_WRITE_BODY;
} else {
next_state_ = STATE_READ_HEADERS;
@@ -686,8 +687,8 @@ int HttpNetworkTransaction::DoWriteHeadersComplete(int result) {
int HttpNetworkTransaction::DoWriteBody() {
next_state_ = STATE_WRITE_BODY_COMPLETE;
- DCHECK(request_->upload_data);
DCHECK(request_body_stream_.get());
+ DCHECK(request_body_stream_->size());
const char* buf = request_body_stream_->buf();
int buf_len = static_cast<int>(request_body_stream_->buf_len());