Index: net/http/http_stream_factory.cc |
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc |
index 003933b71fa6bcb96ac6b42a0e2c0a5b81b82d7f..492b89b4d104fdafe0ec3b19f7b4f4d6faf45193 100644 |
--- a/net/http/http_stream_factory.cc |
+++ b/net/http/http_stream_factory.cc |
@@ -13,6 +13,7 @@ |
#include "net/base/host_port_pair.h" |
#include "net/base/port_util.h" |
#include "net/http/http_network_session.h" |
+#include "net/quic/quic_protocol.h" |
#include "net/spdy/spdy_alt_svc_wire_format.h" |
#include "url/gurl.h" |
@@ -54,6 +55,24 @@ void HttpStreamFactory::ProcessAlternativeService( |
!IsPortValid(alternative_service_entry.port)) { |
continue; |
} |
+ // Check if QUIC version is supported. |
+ if (protocol == QUIC && !alternative_service_entry.version.empty()) { |
+ bool match_found = false; |
+ for (QuicVersion supported : session.params().quic_supported_versions) { |
+ for (uint16 advertised : alternative_service_entry.version) { |
+ if (supported == advertised) { |
+ match_found = true; |
+ break; |
+ } |
+ } |
+ if (match_found) { |
+ break; |
+ } |
+ } |
+ if (!match_found) { |
+ continue; |
+ } |
+ } |
AlternativeService alternative_service(protocol, |
alternative_service_entry.host, |
alternative_service_entry.port); |