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

Unified Diff: net/http/http_network_transaction.cc

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better Close() handling and tests Created 9 years, 4 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
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index f8e362f4b4fcac4609c1bfe9ecca45fd177e5fd6..66e750fb3f8dc3edbe7a5ac12ecd540653ecc3e2 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -39,7 +39,6 @@
#include "net/http/http_proxy_client_socket_pool.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_request_info.h"
-#include "net/http/http_response_body_drainer.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_stream_factory.h"
@@ -133,15 +132,8 @@ HttpNetworkTransaction::~HttpNetworkTransaction() {
stream_->Close(true /* not reusable */);
} else {
// Otherwise, we try to drain the response body.
- // TODO(willchan): Consider moving this response body draining to the
- // stream implementation. For SPDY, there's clearly no point. For
- // HTTP, it can vary depending on whether or not we're pipelining. It's
- // stream dependent, so the different subtypes should be implementing
- // their solutions.
- HttpResponseBodyDrainer* drainer =
- new HttpResponseBodyDrainer(stream_.release());
- drainer->Start(session_);
- // |drainer| will delete itself.
+ HttpStream* stream = stream_.release();
+ stream->Drain(session_);
}
}
}
@@ -479,6 +471,13 @@ void HttpNetworkTransaction::DoCallback(int rv) {
void HttpNetworkTransaction::OnIOComplete(int result) {
int rv = DoLoop(result);
+ if (rv == ERR_PIPELINE_EVICTION) {
+ stream_->Close(false);
+ stream_.reset();
+ stream_request_.reset();
+ next_state_ = STATE_NONE;
+ RestartIgnoringLastError(user_callback_);
mmenke 2011/09/01 21:15:39 You want to return here. Otherwise, you'll pass t
James Simonsen 2011/09/07 21:20:10 Eek. Yep. Fixed. Added test cases for the transact
+ }
if (rv != ERR_IO_PENDING)
DoCallback(rv);
}

Powered by Google App Engine
This is Rietveld 408576698