Chromium Code Reviews| Index: net/http/http_network_transaction.cc |
| diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc |
| index d1e7ec58ce8be7edcf9e90e220c5a878a6350ca5..8f0f124f3db3390839b655b80fe9d0e858c1c2c9 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" |
| @@ -135,15 +134,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_); |
| } |
| } |
| } |
| @@ -576,6 +568,9 @@ int HttpNetworkTransaction::DoLoop(int result) { |
| rv = ERR_FAILED; |
| break; |
| } |
| + if (rv == ERR_PIPELINE_EVICTION) { |
|
willchan no longer on Chromium
2011/09/26 23:49:20
This is breaking our paradigm for the state machin
James Simonsen
2011/09/29 02:39:31
It's for the sake of logging. I want to return ERR
willchan no longer on Chromium
2011/09/29 19:32:48
I pointed out where I think you should do the logg
|
| + rv = RestartAfterPipelineEviction(); |
| + } |
| } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); |
| return rv; |
| @@ -872,6 +867,10 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { |
| if (is_https_request()) |
| stream_->GetSSLInfo(&response_.ssl_info); |
| + if (read_buf_len_) { |
| + next_state_ = STATE_READ_BODY; |
| + } |
| + |
| headers_valid_ = true; |
| return OK; |
| } |
| @@ -1202,6 +1201,14 @@ int HttpNetworkTransaction::HandleIOError(int error) { |
| return error; |
| } |
| +int HttpNetworkTransaction::RestartAfterPipelineEviction() { |
| + stream_->Close(true); |
| + stream_.reset(); |
| + stream_request_.reset(); |
| + next_state_ = STATE_NONE; |
| + return RestartIgnoringLastError(user_callback_); |
| +} |
| + |
| void HttpNetworkTransaction::ResetStateForRestart() { |
| ResetStateForAuthRestart(); |
| stream_.reset(); |