Chromium Code Reviews

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: Fix trybot issues Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index c994051338881273220a93d6d576b22d6bc51a30..d27e5aa8772132780fac5c345e18f8679044b245 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_server_properties.h"
@@ -137,15 +136,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_);
}
}
}
@@ -1198,11 +1190,18 @@ int HttpNetworkTransaction::HandleIOError(int error) {
case ERR_CONNECTION_CLOSED:
case ERR_CONNECTION_ABORTED:
if (ShouldResendRequest(error)) {
+ net_log_.AddEvent(
+ NetLog::TYPE_HTTP_TRANSACTION_RESTART_AFTER_ERROR,
+ make_scoped_refptr(new NetLogIntegerParameter("net_error", error)));
ResetConnectionAndRequestForResend();
error = OK;
}
break;
+ case ERR_PIPELINE_EVICTION:
case ERR_SPDY_SERVER_REFUSED_STREAM:
+ net_log_.AddEvent(
+ NetLog::TYPE_HTTP_TRANSACTION_RESTART_AFTER_ERROR,
+ make_scoped_refptr(new NetLogIntegerParameter("net_error", error)));
ResetConnectionAndRequestForResend();
error = OK;
break;

Powered by Google App Engine