Index: net/http/http_stream_factory_impl_job_controller.cc |
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc |
index c2c818b99d63c16bd7dd9f949e45063212e72d46..207a9c36fed9ec0ac33403bab292ca33df7085ce 100644 |
--- a/net/http/http_stream_factory_impl_job_controller.cc |
+++ b/net/http/http_stream_factory_impl_job_controller.cc |
@@ -1168,6 +1168,12 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceInfoInternal( |
if (!original_url.SchemeIs(url::kHttpsScheme)) |
continue; |
+ // If there is no QUIC version in the advertised versions supported by |
+ // the net stack, ignore this entry. |
+ if (SelectQuicVersion(alternative_service_info.advertised_versions()) == |
+ QUIC_VERSION_UNSUPPORTED) |
+ continue; |
+ |
// Check whether there is an existing QUIC session to use for this origin. |
HostPortPair mapped_origin(origin.host(), origin.port()); |
ignore_result(ApplyHostMappingRules(original_url, &mapped_origin)); |
@@ -1195,6 +1201,25 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceInfoInternal( |
return first_alternative_service_info; |
} |
+QuicVersion HttpStreamFactoryImpl::JobController::SelectQuicVersion( |
+ const QuicVersionVector& advertised_versions) { |
+ const QuicVersionVector& supported_versions = |
+ session_->params().quic_supported_versions; |
+ if (advertised_versions.empty()) |
+ return supported_versions[0]; |
+ |
+ for (const QuicVersion& supported : supported_versions) { |
+ for (const QuicVersion& advertised : advertised_versions) { |
+ if (supported == advertised) { |
+ DCHECK_NE(QUIC_VERSION_UNSUPPORTED, supported); |
+ return supported; |
+ } |
+ } |
+ } |
+ |
+ return QUIC_VERSION_UNSUPPORTED; |
+} |
+ |
bool HttpStreamFactoryImpl::JobController:: |
ShouldCreateAlternativeProxyServerJob( |
const ProxyInfo& proxy_info, |