| Index: net/http/http_pipelined_connection_impl.cc
|
| diff --git a/net/http/http_pipelined_connection_impl.cc b/net/http/http_pipelined_connection_impl.cc
|
| index 82c788f903edbaf88a8861f94bb81e3ea8dcd06d..7792970bf5deac23e985630c0378c710454c4f07 100644
|
| --- a/net/http/http_pipelined_connection_impl.cc
|
| +++ b/net/http/http_pipelined_connection_impl.cc
|
| @@ -9,6 +9,8 @@
|
| #include "net/base/io_buffer.h"
|
| #include "net/http/http_pipelined_stream.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_stream_parser.h"
|
| #include "net/socket/client_socket_handle.h"
|
|
|
| @@ -606,6 +608,22 @@ void HttpPipelinedConnectionImpl::GetSSLCertRequestInfo(
|
| cert_request_info);
|
| }
|
|
|
| +void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream,
|
| + HttpNetworkSession* session) {
|
| + HttpResponseHeaders* headers = stream->GetResponseInfo()->headers;
|
| + if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded() ||
|
| + !usable_) {
|
| + // TODO(simonjam): Drain chunk-encoded responses if they're relatively
|
| + // common.
|
| + stream->Close(true);
|
| + delete stream;
|
| + return;
|
| + }
|
| + HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(stream);
|
| + drainer->StartWithSize(session, headers->GetContentLength());
|
| + // |drainer| will delete itself when done.
|
| +}
|
| +
|
| void HttpPipelinedConnectionImpl::QueueUserCallback(
|
| int pipeline_id,
|
| OldCompletionCallback* callback,
|
|
|