diff options
author | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 20:14:29 +0000 |
---|---|---|
committer | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 20:14:29 +0000 |
commit | 5a60c8bb002e4573dd0809f4a78d56b4c9720add (patch) | |
tree | 4be91c33213b0e7ab66dfed7ced978e8a16b3cdc /net/http/http_network_transaction.cc | |
parent | 8053408224c37ade07452972e01de6126d074d27 (diff) | |
download | chromium_src-5a60c8bb002e4573dd0809f4a78d56b4c9720add.zip chromium_src-5a60c8bb002e4573dd0809f4a78d56b4c9720add.tar.gz chromium_src-5a60c8bb002e4573dd0809f4a78d56b4c9720add.tar.bz2 |
Basic HTTP pipelining support.
This must be enabled in about:flags. It is naive and assumes all servers correctly implement pipelining. Proxies are not supported.
Immediate future work:
- Integration tests.
- Additional NetLog logging.
- Refactor HttpPipelinedConnectionImpl.
Long term:
- Detect broken transparent proxies.
- Detect and/or mitigate broken servers.
- Buffer HttpPipelinedStream.
- Optimize number of pipelines and their depth.
- Support proxies.
BUG=8991
TEST=net_unittests
Review URL: http://codereview.chromium.org/7289006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.cc')
-rw-r--r-- | net/http/http_network_transaction.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 84df782..c66f0f3 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,12 +1190,19 @@ 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_PING_FAILED: 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; |