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

Unified Diff: net/http/http_stream_factory.cc

Issue 1406923010: Observe v= parameter when processing Alternative Services header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #3. Created 5 years, 2 months 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
« no previous file with comments | « no previous file | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698