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

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: 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..9364f8c0471c2ec6d6a43194939f8a992d69f0e0 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,23 @@ void HttpStreamFactory::ProcessAlternativeService(
!IsPortValid(alternative_service_entry.port)) {
continue;
}
+ // Check if QUIC version is supported.
+ if (protocol == QUIC && !alternative_service_entry.version.empty()) {
+ SpdyAltSvcWireFormat::VersionVector::const_iterator begin =
+ alternative_service_entry.version.begin();
+ SpdyAltSvcWireFormat::VersionVector::const_iterator end =
+ alternative_service_entry.version.end();
+ bool match_found = false;
+ for (QuicVersion supported : session.params().quic_supported_versions) {
+ if (std::find(begin, end, static_cast<uint16>(supported)) != end) {
+ match_found = true;
Ryan Hamilton 2015/10/29 20:07:23 Up to you, but instead of using std::find, I wonde
+ 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