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

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

Issue 2192193002: Remove a DCHECK on ClientSocketHandle state from proxy code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // 501 response bodies that contain a useful error message. For 504 // 501 response bodies that contain a useful error message. For
505 // example, Squid uses a 404 response to report the DNS error: "The 505 // example, Squid uses a 404 response to report the DNS error: "The
506 // domain name does not exist." 506 // domain name does not exist."
507 LogBlockedTunnelResponse(); 507 LogBlockedTunnelResponse();
508 return ERR_TUNNEL_CONNECTION_FAILED; 508 return ERR_TUNNEL_CONNECTION_FAILED;
509 } 509 }
510 } 510 }
511 511
512 int HttpProxyClientSocket::DoDrainBody() { 512 int HttpProxyClientSocket::DoDrainBody() {
513 DCHECK(drain_buf_.get()); 513 DCHECK(drain_buf_.get());
514 DCHECK(transport_->is_initialized());
515 next_state_ = STATE_DRAIN_BODY_COMPLETE; 514 next_state_ = STATE_DRAIN_BODY_COMPLETE;
516 return http_stream_parser_->ReadResponseBody( 515 return http_stream_parser_->ReadResponseBody(
517 drain_buf_.get(), kDrainBodyBufferSize, io_callback_); 516 drain_buf_.get(), kDrainBodyBufferSize, io_callback_);
518 } 517 }
519 518
520 int HttpProxyClientSocket::DoDrainBodyComplete(int result) { 519 int HttpProxyClientSocket::DoDrainBodyComplete(int result) {
521 if (result < 0) 520 if (result < 0)
522 return ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH; 521 return ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH;
523 522
524 if (!http_stream_parser_->IsResponseBodyComplete()) { 523 if (!http_stream_parser_->IsResponseBodyComplete()) {
525 // Keep draining. 524 // Keep draining.
526 next_state_ = STATE_DRAIN_BODY; 525 next_state_ = STATE_DRAIN_BODY;
527 return OK; 526 return OK;
528 } 527 }
529 528
530 return DidDrainBodyForAuthRestart(); 529 return DidDrainBodyForAuthRestart();
531 } 530 }
532 531
533 //---------------------------------------------------------------- 532 //----------------------------------------------------------------
534 533
535 } // namespace net 534 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698