OLD | NEW |
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 Loading... |
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. | |
414 spdy_stream_->DetachDelegate(); | 413 spdy_stream_->DetachDelegate(); |
415 next_state_ = STATE_DISCONNECTED; | 414 next_state_ = STATE_DISCONNECTED; |
416 return ERR_HTTPS_PROXY_TUNNEL_RESPONSE; | 415 return ERR_HTTPS_PROXY_TUNNEL_RESPONSE; |
417 } else { | 416 } else { |
418 LogBlockedTunnelResponse(); | 417 LogBlockedTunnelResponse(); |
419 return ERR_TUNNEL_CONNECTION_FAILED; | 418 return ERR_TUNNEL_CONNECTION_FAILED; |
420 } | 419 } |
421 | 420 |
422 case 407: // Proxy Authentication Required | 421 case 407: // Proxy Authentication Required |
423 next_state_ = STATE_OPEN; | 422 next_state_ = STATE_OPEN; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } else if (!read_callback_.is_null()) { | 516 } else if (!read_callback_.is_null()) { |
518 // If we have a read_callback_, the we need to make sure we call it back. | 517 // If we have a read_callback_, the we need to make sure we call it back. |
519 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 518 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
520 } | 519 } |
521 // This may have been deleted by read_callback_, so check first. | 520 // This may have been deleted by read_callback_, so check first. |
522 if (weak_ptr.get() && !write_callback.is_null()) | 521 if (weak_ptr.get() && !write_callback.is_null()) |
523 write_callback.Run(ERR_CONNECTION_CLOSED); | 522 write_callback.Run(ERR_CONNECTION_CLOSED); |
524 } | 523 } |
525 | 524 |
526 } // namespace net | 525 } // namespace net |
OLD | NEW |