summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorerikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 19:13:24 +0000
committererikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 19:13:24 +0000
commitb261d0ea539baa5c3d997f0d98936fcaf319773c (patch)
tree0ab9d2069840fe98b67878fcab414bc0937c5544 /net/http
parentfa038d558eb0ec799555d7433e9768d6de860968 (diff)
downloadchromium_src-b261d0ea539baa5c3d997f0d98936fcaf319773c.zip
chromium_src-b261d0ea539baa5c3d997f0d98936fcaf319773c.tar.gz
chromium_src-b261d0ea539baa5c3d997f0d98936fcaf319773c.tar.bz2
SpdySessionPool now identifies SpdySessions by both HostPortPair and proxy settings.
This ensures SpdySessions are not improperly reused. TEST=net_unittests BUG=49874 Review URL: http://codereview.chromium.org/3047032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54577 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc12
-rw-r--r--net/http/http_network_transaction_unittest.cc4
2 files changed, 9 insertions, 7 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index a3624f3..966eccb 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -744,7 +744,8 @@ int HttpNetworkTransaction::DoInitConnection() {
// Check first if we have a spdy session for this group. If so, then go
// straight to using that.
- if (session_->spdy_session_pool()->HasSession(endpoint_)) {
+ HostPortProxyPair pair(endpoint_, proxy_info_.ToPacString());
+ if (session_->spdy_session_pool()->HasSession(pair)) {
using_spdy_ = true;
reused_socket_ = true;
next_state_ = STATE_SPDY_GET_STREAM;
@@ -1323,8 +1324,9 @@ int HttpNetworkTransaction::DoSpdyGetStream() {
session_->spdy_session_pool();
scoped_refptr<SpdySession> spdy_session;
- if (spdy_pool->HasSession(endpoint_)) {
- spdy_session = spdy_pool->Get(endpoint_, session_, net_log_);
+ HostPortProxyPair pair(endpoint_, proxy_info_.ToPacString());
+ if (spdy_pool->HasSession(pair)) {
+ spdy_session = spdy_pool->Get(pair, session_, net_log_);
} else {
if(using_ssl_) {
// SPDY can be negotiated using the TLS next protocol negotiation (NPN)
@@ -1332,7 +1334,7 @@ int HttpNetworkTransaction::DoSpdyGetStream() {
// contain an SSLClientSocket.
CHECK(connection_->socket());
int error = spdy_pool->GetSpdySessionFromSocket(
- endpoint_, session_, connection_.release(), net_log_,
+ pair, session_, connection_.release(), net_log_,
spdy_certificate_error_, &spdy_session, true);
if (error != OK)
return error;
@@ -1340,7 +1342,7 @@ int HttpNetworkTransaction::DoSpdyGetStream() {
else {
// We may want SPDY without SSL
int error = spdy_pool->GetSpdySessionFromSocket(
- endpoint_, session_, connection_.release(), net_log_,
+ pair, session_, connection_.release(), net_log_,
spdy_certificate_error_, &spdy_session, false);
if (error != OK)
return error;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index ea087d0..ec54865 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -5606,9 +5606,9 @@ TEST_F(HttpNetworkTransactionTest,
EXPECT_EQ("hello world", response_data);
// Set up an initial SpdySession in the pool to reuse.
+ HostPortProxyPair pair(HostPortPair("www.google.com", 443), "DIRECT");
scoped_refptr<SpdySession> spdy_session =
- session->spdy_session_pool()->Get(HostPortPair("www.google.com", 443),
- session, BoundNetLog());
+ session->spdy_session_pool()->Get(pair, session, BoundNetLog());
scoped_refptr<TCPSocketParams> tcp_params =
new TCPSocketParams("www.google.com", 443, MEDIUM, GURL(), false);
spdy_session->Connect("www.google.com:443", tcp_params, MEDIUM);