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 65ecd110ab9e221008e6efa3587ea0afb5c84ec9..1bf541bf0ea68607dc384d7f2f5c1bb266db827b 100644 |
--- a/net/http/http_server_properties_impl.cc |
+++ b/net/http/http_server_properties_impl.cc |
@@ -67,7 +67,7 @@ void HttpServerPropertiesImpl::InitializeAlternateProtocolServers( |
} |
// Attempt to find canonical servers. |
- int canonical_ports[] = { 80, 443 }; |
+ uint16 canonical_ports[] = { 80, 443 }; |
for (size_t i = 0; i < canonical_suffixes_.size(); ++i) { |
std::string canonical_suffix = canonical_suffixes_[i]; |
for (size_t j = 0; j < arraysize(canonical_ports); ++j) { |
@@ -301,8 +301,14 @@ void HttpServerPropertiesImpl::SetBrokenAlternateProtocol( |
const HostPortPair& server) { |
AlternateProtocolMap::iterator it = alternate_protocol_map_.Get(server); |
if (it == alternate_protocol_map_.end()) { |
- LOG(DFATAL) << "Trying to mark unknown alternate protocol broken."; |
- return; |
+ if (!HasAlternateProtocol(server)) { |
+ LOG(DFATAL) << "Trying to mark unknown alternate protocol broken."; |
+ return; |
+ } |
+ // This server's alternate protocol information is coming from a canonical |
+ // server. Add an entry in the map for this server explicitly so that |
+ // it can be marked as broken. |
+ it = alternate_protocol_map_.Put(server, GetAlternateProtocol(server)); |
} |
it->second.is_broken = true; |
int count = ++broken_alternate_protocol_map_[server]; |