Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: net/http/http_pipelined_connection_impl.cc

Issue 197283012: Retry requests on reused sockets that receive ERR_EMPTY_RESPONSE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indentation Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_proxy_client_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_pipelined_connection_impl.h" 5 #include "net/http/http_pipelined_connection_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 if (pipeline_id > 1) { 643 if (pipeline_id > 1) {
644 return true; 644 return true;
645 } 645 }
646 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type(); 646 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type();
647 return connection_->is_reused() || 647 return connection_->is_reused() ||
648 reuse_type == ClientSocketHandle::UNUSED_IDLE; 648 reuse_type == ClientSocketHandle::UNUSED_IDLE;
649 } 649 }
650 650
651 void HttpPipelinedConnectionImpl::SetConnectionReused(int pipeline_id) { 651 void HttpPipelinedConnectionImpl::SetConnectionReused(int pipeline_id) {
652 CHECK(ContainsKey(stream_info_map_, pipeline_id)); 652 CHECK(ContainsKey(stream_info_map_, pipeline_id));
653 connection_->set_is_reused(true); 653 connection_->set_reuse_type(ClientSocketHandle::REUSED_IDLE);
654 } 654 }
655 655
656 int64 HttpPipelinedConnectionImpl::GetTotalReceivedBytes( 656 int64 HttpPipelinedConnectionImpl::GetTotalReceivedBytes(
657 int pipeline_id) const { 657 int pipeline_id) const {
658 CHECK(ContainsKey(stream_info_map_, pipeline_id)); 658 CHECK(ContainsKey(stream_info_map_, pipeline_id));
659 if (stream_info_map_.find(pipeline_id)->second.parser.get()) 659 if (stream_info_map_.find(pipeline_id)->second.parser.get())
660 return stream_info_map_.find(pipeline_id)->second.parser->received_bytes(); 660 return stream_info_map_.find(pipeline_id)->second.parser->received_bytes();
661 return 0; 661 return 0;
662 } 662 }
663 663
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 } 837 }
838 838
839 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo() 839 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo()
840 : state(STREAM_CREATED) { 840 : state(STREAM_CREATED) {
841 } 841 }
842 842
843 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() { 843 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() {
844 } 844 }
845 845
846 } // namespace net 846 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_proxy_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698