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

Side by Side Diff: net/http/http_stream_parser.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_proxy_client_socket.cc ('k') | net/socket/client_socket_handle.h » ('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_stream_parser.h" 5 #include "net/http/http_stream_parser.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 return read_buf_->offset() > read_buf_unused_offset_; 897 return read_buf_->offset() > read_buf_unused_offset_;
898 } 898 }
899 899
900 bool HttpStreamParser::IsConnectionReused() const { 900 bool HttpStreamParser::IsConnectionReused() const {
901 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type(); 901 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type();
902 return connection_->is_reused() || 902 return connection_->is_reused() ||
903 reuse_type == ClientSocketHandle::UNUSED_IDLE; 903 reuse_type == ClientSocketHandle::UNUSED_IDLE;
904 } 904 }
905 905
906 void HttpStreamParser::SetConnectionReused() { 906 void HttpStreamParser::SetConnectionReused() {
907 connection_->set_is_reused(true); 907 connection_->set_reuse_type(ClientSocketHandle::REUSED_IDLE);
908 } 908 }
909 909
910 bool HttpStreamParser::IsConnectionReusable() const { 910 bool HttpStreamParser::IsConnectionReusable() const {
911 return connection_->socket() && connection_->socket()->IsConnectedAndIdle(); 911 return connection_->socket() && connection_->socket()->IsConnectedAndIdle();
912 } 912 }
913 913
914 void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) { 914 void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) {
915 if (request_->url.SchemeIsSecure() && connection_->socket()) { 915 if (request_->url.SchemeIsSecure() && connection_->socket()) {
916 SSLClientSocket* ssl_socket = 916 SSLClientSocket* ssl_socket =
917 static_cast<SSLClientSocket*>(connection_->socket()); 917 static_cast<SSLClientSocket*>(connection_->socket());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 request_body->IsInMemory() && 961 request_body->IsInMemory() &&
962 request_body->size() > 0) { 962 request_body->size() > 0) {
963 size_t merged_size = request_headers.size() + request_body->size(); 963 size_t merged_size = request_headers.size() + request_body->size();
964 if (merged_size <= kMaxMergedHeaderAndBodySize) 964 if (merged_size <= kMaxMergedHeaderAndBodySize)
965 return true; 965 return true;
966 } 966 }
967 return false; 967 return false;
968 } 968 }
969 969
970 } // namespace net 970 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/socket/client_socket_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698