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

Side by Side Diff: net/spdy/spdy_proxy_client_socket.cc

Issue 305823003: Re-land: Defer SpdySession destruction to support closing writes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Regression tests and fix for crbug.com/379469 Created 6 years, 6 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
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/spdy/spdy_proxy_client_socket.h" 5 #include "net/spdy/spdy_proxy_client_socket.h"
6 6
7 #include <algorithm> // min 7 #include <algorithm> // min
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 case 200: // OK 403 case 200: // OK
404 next_state_ = STATE_OPEN; 404 next_state_ = STATE_OPEN;
405 return OK; 405 return OK;
406 406
407 case 302: // Found / Moved Temporarily 407 case 302: // Found / Moved Temporarily
408 // Try to return a sanitized response so we can follow auth redirects. 408 // Try to return a sanitized response so we can follow auth redirects.
409 // If we can't, fail the tunnel connection. 409 // If we can't, fail the tunnel connection.
410 if (SanitizeProxyRedirect(&response_, request_.url)) { 410 if (SanitizeProxyRedirect(&response_, request_.url)) {
411 redirect_has_load_timing_info_ = 411 redirect_has_load_timing_info_ =
412 spdy_stream_->GetLoadTimingInfo(&redirect_load_timing_info_); 412 spdy_stream_->GetLoadTimingInfo(&redirect_load_timing_info_);
413 // Note that this triggers a RST_STREAM_CANCEL.
413 spdy_stream_->DetachDelegate(); 414 spdy_stream_->DetachDelegate();
414 next_state_ = STATE_DISCONNECTED; 415 next_state_ = STATE_DISCONNECTED;
415 return ERR_HTTPS_PROXY_TUNNEL_RESPONSE; 416 return ERR_HTTPS_PROXY_TUNNEL_RESPONSE;
416 } else { 417 } else {
417 LogBlockedTunnelResponse(); 418 LogBlockedTunnelResponse();
418 return ERR_TUNNEL_CONNECTION_FAILED; 419 return ERR_TUNNEL_CONNECTION_FAILED;
419 } 420 }
420 421
421 case 407: // Proxy Authentication Required 422 case 407: // Proxy Authentication Required
422 next_state_ = STATE_OPEN; 423 next_state_ = STATE_OPEN;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 } else if (!read_callback_.is_null()) { 517 } else if (!read_callback_.is_null()) {
517 // If we have a read_callback_, the we need to make sure we call it back. 518 // If we have a read_callback_, the we need to make sure we call it back.
518 OnDataReceived(scoped_ptr<SpdyBuffer>()); 519 OnDataReceived(scoped_ptr<SpdyBuffer>());
519 } 520 }
520 // This may have been deleted by read_callback_, so check first. 521 // This may have been deleted by read_callback_, so check first.
521 if (weak_ptr.get() && !write_callback.is_null()) 522 if (weak_ptr.get() && !write_callback.is_null())
522 write_callback.Run(ERR_CONNECTION_CLOSED); 523 write_callback.Run(ERR_CONNECTION_CLOSED);
523 } 524 }
524 525
525 } // namespace net 526 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698