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

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

Issue 3192011: Make sure the key into the spdy session pool identifies the actual proxy used... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rework some comments Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/proxy/proxy_info.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_request.h" 5 #include "net/http/http_stream_request.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/connection_type_histograms.h" 10 #include "net/base/connection_type_histograms.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 bool want_spdy_over_npn = 416 bool want_spdy_over_npn =
417 alternate_protocol_mode_ == kUsingAlternateProtocol && 417 alternate_protocol_mode_ == kUsingAlternateProtocol &&
418 alternate_protocol_ == HttpAlternateProtocols::NPN_SPDY_2; 418 alternate_protocol_ == HttpAlternateProtocols::NPN_SPDY_2;
419 using_ssl_ = request_info().url.SchemeIs("https") || 419 using_ssl_ = request_info().url.SchemeIs("https") ||
420 (force_spdy_always_ && force_spdy_over_ssl_) || 420 (force_spdy_always_ && force_spdy_over_ssl_) ||
421 want_spdy_over_npn; 421 want_spdy_over_npn;
422 using_spdy_ = false; 422 using_spdy_ = false;
423 423
424 // Check first if we have a spdy session for this group. If so, then go 424 // Check first if we have a spdy session for this group. If so, then go
425 // straight to using that. 425 // straight to using that.
426 HostPortProxyPair pair(endpoint_, proxy_info()->ToPacString()); 426 HostPortProxyPair pair(endpoint_, proxy_info()->proxy_server().ToPacString());
Mike Belshe 2010/08/24 15:19:58 Because HostPortProxyPair takes a string, this bug
eroman 2010/08/25 01:34:57 Indeed, that is a very good idea. I will do a fol
427 if (session_->spdy_session_pool()->HasSession(pair)) { 427 if (session_->spdy_session_pool()->HasSession(pair)) {
428 using_spdy_ = true; 428 using_spdy_ = true;
429 next_state_ = STATE_INIT_STREAM; 429 next_state_ = STATE_INIT_STREAM;
430 return OK; 430 return OK;
431 } 431 }
432 432
433 // Build the string used to uniquely identify connections of this type. 433 // Build the string used to uniquely identify connections of this type.
434 // Determine the host and port to connect to. 434 // Determine the host and port to connect to.
435 std::string connection_group = endpoint_.ToString(); 435 std::string connection_group = endpoint_.ToString();
436 DCHECK(!connection_group.empty()); 436 DCHECK(!connection_group.empty());
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 stream_.reset(new HttpStreamHandle(connection_.release(), stream)); 680 stream_.reset(new HttpStreamHandle(connection_.release(), stream));
681 return stream_->InitializeStream(&request_info(), net_log_, &io_callback_); 681 return stream_->InitializeStream(&request_info(), net_log_, &io_callback_);
682 } 682 }
683 683
684 CHECK(!stream_.get()); 684 CHECK(!stream_.get());
685 685
686 const scoped_refptr<SpdySessionPool> spdy_pool = 686 const scoped_refptr<SpdySessionPool> spdy_pool =
687 session_->spdy_session_pool(); 687 session_->spdy_session_pool();
688 scoped_refptr<SpdySession> spdy_session; 688 scoped_refptr<SpdySession> spdy_session;
689 689
690 HostPortProxyPair pair(endpoint_, proxy_info()->ToPacString()); 690 HostPortProxyPair pair(endpoint_,
691 proxy_info()->proxy_server().ToPacString());
691 if (session_->spdy_session_pool()->HasSession(pair)) { 692 if (session_->spdy_session_pool()->HasSession(pair)) {
692 spdy_session = 693 spdy_session =
693 session_->spdy_session_pool()->Get(pair, session_, net_log_); 694 session_->spdy_session_pool()->Get(pair, session_, net_log_);
694 } else { 695 } else {
695 // SPDY can be negotiated using the TLS next protocol negotiation (NPN) 696 // SPDY can be negotiated using the TLS next protocol negotiation (NPN)
696 // extension, or just directly using SSL. Either way, |connection_| must 697 // extension, or just directly using SSL. Either way, |connection_| must
697 // contain an SSLClientSocket. 698 // contain an SSLClientSocket.
698 CHECK(connection_->socket()); 699 CHECK(connection_->socket());
699 int error = spdy_pool->GetSpdySessionFromSocket( 700 int error = spdy_pool->GetSpdySessionFromSocket(
700 pair, session_, connection_.release(), net_log_, 701 pair, session_, connection_.release(), net_log_,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 100); 913 100);
913 break; 914 break;
914 default: 915 default:
915 NOTREACHED(); 916 NOTREACHED();
916 break; 917 break;
917 } 918 }
918 } 919 }
919 920
920 } // namespace net 921 } // namespace net
921 922
OLDNEW
« no previous file with comments | « no previous file | net/proxy/proxy_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698