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

Unified Diff: net/http/http_network_transaction.cc

Issue 63139: Add a boolean data member called_socket_read_ to help... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months 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/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
===================================================================
--- net/http/http_network_transaction.cc (revision 13379)
+++ net/http/http_network_transaction.cc (working copy)
@@ -49,6 +49,7 @@
using_proxy_(false),
using_tunnel_(false),
establishing_tunnel_(false),
+ reading_body_from_socket_(false),
request_headers_bytes_sent_(0),
header_buf_capacity_(0),
header_buf_len_(0),
@@ -832,6 +833,7 @@
return n;
}
+ reading_body_from_socket_ = true;
return connection_.socket()->Read(read_buf_->data(), read_buf_len_,
&io_callback_);
}
@@ -841,7 +843,8 @@
DCHECK(!establishing_tunnel_) <<
"We should never read a response body of a tunnel.";
- bool unfiltered_eof = (result == 0);
+ bool unfiltered_eof = (result == 0 && reading_body_from_socket_);
+ reading_body_from_socket_ = false;
// Filter incoming data if appropriate. FilterBuf may return an error.
if (result > 0 && chunked_decoder_.get()) {
@@ -905,7 +908,8 @@
// method are almost the same. Figure out a good way for these two methods
// to share code.
int HttpNetworkTransaction::DoDrainBodyForAuthRestartComplete(int result) {
- bool unfiltered_eof = (result == 0);
+ bool unfiltered_eof = (result == 0 && reading_body_from_socket_);
+ reading_body_from_socket_ = false;
// Filter incoming data if appropriate. FilterBuf may return an error.
if (result > 0 && chunked_decoder_.get()) {
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698