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

Unified Diff: net/tools/quic/quic_dispatcher.cc

Issue 2100863003: Disable QUIC v29 and earlier. Protected by FLAGS_quic_disable_pre_30. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixing compile error on android. Created 4 years, 6 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 | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.cc
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index ff325f5e1baef9b4730063c218f4ba83659d4b3f..70f2af14411122c07acea6ae675d938966a3482a 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -201,6 +201,8 @@ QuicDispatcher::QuicDispatcher(
delete_sessions_alarm_(
alarm_factory_->CreateAlarm(new DeleteSessionsAlarm(this))),
supported_versions_(supported_versions),
+ disable_quic_pre_30_(FLAGS_quic_disable_pre_30),
+ allowed_supported_versions_(supported_versions),
current_packet_(nullptr),
framer_(supported_versions,
/*unused*/ QuicTime::Zero(),
@@ -283,7 +285,7 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
// Unless the packet provides a version, assume that we can continue
// processing using our preferred version.
- QuicVersion version = supported_versions_.front();
+ QuicVersion version = GetSupportedVersions().front();
if (header.version_flag) {
QuicVersion packet_version = header.versions.front();
if (!framer_.IsSupportedVersion(packet_version)) {
@@ -293,7 +295,7 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
// Since the version is not supported, send a version negotiation
// packet and stop processing the current packet.
time_wait_list_manager()->SendVersionNegotiationPacket(
- connection_id, supported_versions_, current_server_address_,
+ connection_id, GetSupportedVersions(), current_server_address_,
current_client_address_);
return false;
}
@@ -599,7 +601,7 @@ QuicServerSessionBase* QuicDispatcher::CreateQuicSession(
QuicConnection* connection = new QuicConnection(
connection_id, client_address, helper_.get(), alarm_factory_.get(),
CreatePerConnectionWriter(),
- /* owns_writer= */ true, Perspective::IS_SERVER, supported_versions_);
+ /* owns_writer= */ true, Perspective::IS_SERVER, GetSupportedVersions());
QuicServerSessionBase* session = new QuicSimpleServerSession(
config_, connection, this, session_helper_.get(), crypto_config_,
@@ -720,4 +722,15 @@ QuicDispatcher::QuicPacketFate QuicDispatcher::MaybeRejectStatelessly(
return kFateDrop;
}
+const QuicVersionVector& QuicDispatcher::GetSupportedVersions() {
+ // Filter (or un-filter) the list of supported versions based on the flag.
+ if (disable_quic_pre_30_ != FLAGS_quic_disable_pre_30) {
+ DCHECK_EQ(supported_versions_.capacity(),
+ allowed_supported_versions_.capacity());
+ disable_quic_pre_30_ = FLAGS_quic_disable_pre_30;
+ supported_versions_ = FilterSupportedVersions(allowed_supported_versions_);
+ }
+ return supported_versions_;
+}
+
} // namespace net
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698