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

Side by Side Diff: net/http/http_proxy_client_socket.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_pipelined_connection_impl.cc ('k') | net/http/http_stream_parser.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_proxy_client_socket.h" 5 #include "net/http/http_proxy_client_socket.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/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 // We don't need to drain the response body, so we act as if we had drained 271 // We don't need to drain the response body, so we act as if we had drained
272 // the response body. 272 // the response body.
273 return DidDrainBodyForAuthRestart(keep_alive); 273 return DidDrainBodyForAuthRestart(keep_alive);
274 } 274 }
275 275
276 int HttpProxyClientSocket::DidDrainBodyForAuthRestart(bool keep_alive) { 276 int HttpProxyClientSocket::DidDrainBodyForAuthRestart(bool keep_alive) {
277 if (keep_alive && transport_->socket()->IsConnectedAndIdle()) { 277 if (keep_alive && transport_->socket()->IsConnectedAndIdle()) {
278 next_state_ = STATE_GENERATE_AUTH_TOKEN; 278 next_state_ = STATE_GENERATE_AUTH_TOKEN;
279 transport_->set_is_reused(true); 279 transport_->set_reuse_type(ClientSocketHandle::REUSED_IDLE);
280 } else { 280 } else {
281 // This assumes that the underlying transport socket is a TCP socket, 281 // This assumes that the underlying transport socket is a TCP socket,
282 // since only TCP sockets are restartable. 282 // since only TCP sockets are restartable.
283 next_state_ = STATE_TCP_RESTART; 283 next_state_ = STATE_TCP_RESTART;
284 transport_->socket()->Disconnect(); 284 transport_->socket()->Disconnect();
285 } 285 }
286 286
287 // Reset the other member variables. 287 // Reset the other member variables.
288 drain_buf_ = NULL; 288 drain_buf_ = NULL;
289 parser_buf_ = NULL; 289 parser_buf_ = NULL;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 529
530 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { 530 int HttpProxyClientSocket::DoTCPRestartComplete(int result) {
531 if (result != OK) 531 if (result != OK)
532 return result; 532 return result;
533 533
534 next_state_ = STATE_GENERATE_AUTH_TOKEN; 534 next_state_ = STATE_GENERATE_AUTH_TOKEN;
535 return result; 535 return result;
536 } 536 }
537 537
538 } // namespace net 538 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_pipelined_connection_impl.cc ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698