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

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

Issue 1716453002: relnote: Make QUIC version negotiation stateless. The QUIC dispatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/quic_dispatcher_test.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 bcfd92b4c8d66f3e79781270c8577e4781678056..a4d43cdd1cb9dcf86c2354585234f7a21466b40b 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -90,6 +90,8 @@ void QuicDispatcher::ProcessPacket(const IPEndPoint& server_address,
bool QuicDispatcher::OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) {
+ current_connection_id_ = header.connection_id;
+
// Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC.
// Given that we can't even send a reply rejecting the packet, just drop the
// packet.
@@ -137,12 +139,22 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
if (framer_.IsSupportedVersion(packet_version)) {
version = packet_version;
} else {
- // Packets set to be processed but having an unsupported version will
- // cause a connection to be created. The connection will handle
- // sending a version negotiation packet.
- // TODO(ianswett): This will malfunction if the full header of the packet
- // causes a parsing error when parsed using the server's preferred
- // version.
+ if (FLAGS_quic_stateless_version_negotiation) {
+ DVLOG(1) << "Version mismatch, connection ID " << connection_id;
+ // 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_,
+ current_client_address_);
+ return false;
+ } else {
+ // Packets set to be processed but having an unsupported version will
+ // cause a connection to be created. The connection will handle
+ // sending a version negotiation packet.
+ // TODO(ianswett): This will malfunction if the full header of the
+ // packet causes a parsing error when parsed using the server's
+ // preferred version.
+ }
}
}
// Set the framer's version and continue processing.
@@ -336,6 +348,11 @@ void QuicDispatcher::OnError(QuicFramer* framer) {
bool QuicDispatcher::OnProtocolVersionMismatch(
QuicVersion /*received_version*/) {
+ if (FLAGS_quic_stateless_version_negotiation) {
+ QUIC_BUG_IF(!time_wait_list_manager_->IsConnectionIdInTimeWait(
+ current_connection_id_));
+ }
+
// Keep processing after protocol mismatch - this will be dealt with by the
// time wait list or connection that we will create.
return true;
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698