Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 AddressList addresses; | 246 AddressList addresses; |
| 247 if (!LookupAddresses(host_port_proxy_pair, &addresses)) | 247 if (!LookupAddresses(host_port_proxy_pair, &addresses)) |
| 248 return NULL; | 248 return NULL; |
| 249 const addrinfo* address = addresses.head(); | 249 const addrinfo* address = addresses.head(); |
| 250 while (address) { | 250 while (address) { |
| 251 IPEndPoint endpoint; | 251 IPEndPoint endpoint; |
| 252 endpoint.FromSockAddr(address->ai_addr, address->ai_addrlen); | 252 endpoint.FromSockAddr(address->ai_addr, address->ai_addrlen); |
| 253 address = address->ai_next; | 253 address = address->ai_next; |
| 254 | 254 |
| 255 SpdyAliasMap::const_iterator it = aliases_.find(endpoint); | 255 SpdyAliasMap::const_iterator it = aliases_.find(endpoint); |
| 256 if (it == aliases_.end()) | 256 if (it == aliases_.end()) { |
| 257 continue; | 257 continue; |
| 258 } | |
|
jar (doing other things)
2012/02/22 17:38:25
nit: No need to add this when there is only one li
Ryan Hamilton
2012/02/22 17:50:10
Whoops! I missed that before sending it to you.
| |
| 258 | 259 |
| 259 // We found an alias. | 260 // We found an alias. |
| 260 const HostPortProxyPair& alias_pair = it->second; | 261 const HostPortProxyPair& alias_pair = it->second; |
| 261 | 262 |
| 262 // If the proxy settings match, we can reuse this session. | 263 // If the proxy settings match, we can reuse this session. |
| 263 if (!(alias_pair.second == host_port_proxy_pair.second)) | 264 if (!(alias_pair.second == host_port_proxy_pair.second)) |
| 264 continue; | 265 continue; |
| 265 | 266 |
| 266 SpdySessionList* list = GetSessionList(alias_pair); | 267 SpdySessionList* list = GetSessionList(alias_pair); |
| 267 if (!list) { | 268 if (!list) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 // Assumes there is only 1 element in the list | 429 // Assumes there is only 1 element in the list |
| 429 SpdySessionList::iterator session_it = list->begin(); | 430 SpdySessionList::iterator session_it = list->begin(); |
| 430 const scoped_refptr<SpdySession>& session = *session_it; | 431 const scoped_refptr<SpdySession>& session = *session_it; |
| 431 CHECK(session); | 432 CHECK(session); |
| 432 if (!session->is_active()) | 433 if (!session->is_active()) |
| 433 session->CloseSessionOnError(net::ERR_ABORTED, true); | 434 session->CloseSessionOnError(net::ERR_ABORTED, true); |
| 434 } | 435 } |
| 435 } | 436 } |
| 436 | 437 |
| 437 } // namespace net | 438 } // namespace net |
| OLD | NEW |