Chromium Code Reviews| Index: net/http/http_server_properties_impl.cc |
| diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc |
| index a8bc04a685980d1f5adb6d1ec778cdbc58f77968..1e697406fea55d8fb433b50cd3bffbd1fb6d0a22 100644 |
| --- a/net/http/http_server_properties_impl.cc |
| +++ b/net/http/http_server_properties_impl.cc |
| @@ -282,9 +282,19 @@ void HttpServerPropertiesImpl::SetAlternateProtocol( |
| AlternateProtocolInfo alternate(alternate_port, |
| alternate_protocol, |
| alternate_probability); |
| - if (HasAlternateProtocol(server)) { |
| - const AlternateProtocolInfo existing_alternate = |
| - GetAlternateProtocol(server); |
| + // Do not call HasAlternateProtocol(), because we do not care about |
| + // |g_forced_alternate_protocol|, or whether the alternate protocol |
| + // probability is higher than the threshold. |
| + AlternateProtocolMap::iterator it = alternate_protocol_map_.Get(server); |
| + if (it == alternate_protocol_map_.end()) { |
| + const CanonicalHostMap::const_iterator canonical_host = |
| + GetCanonicalHost(server); |
| + if (canonical_host != canonical_host_to_origin_map_.end()) { |
| + it = alternate_protocol_map_.Get(canonical_host->second); |
| + } |
| + } |
|
Ryan Hamilton
2015/01/16 22:42:45
This looks like a good change. I wonder if this sh
Bence
2015/01/23 16:45:58
Done.
|
| + if (it != alternate_protocol_map_.end()) { |
| + const AlternateProtocolInfo existing_alternate = it->second; |
| if (existing_alternate.is_broken) { |
| DVLOG(1) << "Ignore alternate protocol since it's known to be broken."; |