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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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];
« no previous file with comments | « net/http/http_proxy_client_socket_pool_unittest.cc ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698