Chromium Code Reviews| 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..7c45da878df45306fb3e150b63a44d3a9aa9a430 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,21 @@ void HttpPipelinedConnectionImpl::GetSSLCertRequestInfo( |
| cert_request_info); |
| } |
| +void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream, |
| + HttpNetworkSession* session) { |
| + HttpResponseHeaders* headers = stream->GetResponseInfo()->headers; |
| + if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded()) { |
|
mmenke
2011/11/30 00:52:59
One more comment. Feel free to worry about it lat
James Simonsen
2011/11/30 19:39:14
Done.
|
| + // 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, |