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

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

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_client_session_test.cc ('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 f528b2ecc4faab8fb7dcf364aba09e5589d34457..c5a72005340377d21a64b63dd8550d38e73a5bcb 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -137,28 +137,18 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
QuicVersion version = supported_versions_.front();
if (header.version_flag) {
QuicVersion packet_version = header.versions.front();
- if (framer_.IsSupportedVersion(packet_version)) {
- version = packet_version;
- } else {
- if (FLAGS_quic_stateless_version_negotiation) {
- if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) {
- return true;
- }
- // 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.
+ if (!framer_.IsSupportedVersion(packet_version)) {
+ if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) {
+ return true;
}
+ // 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;
}
+ version = packet_version;
}
// Set the framer's version and continue processing.
framer_.set_version(version);
@@ -353,14 +343,11 @@ bool QuicDispatcher::ShouldCreateSessionForUnknownVersion(QuicTag version_tag) {
bool QuicDispatcher::OnProtocolVersionMismatch(
QuicVersion /*received_version*/) {
- if (FLAGS_quic_stateless_version_negotiation) {
- QUIC_BUG_IF(
- !time_wait_list_manager_->IsConnectionIdInTimeWait(
- current_connection_id_) &&
- !ShouldCreateSessionForUnknownVersion(framer_.last_version_tag()))
- << "Unexpected version mismatch: "
- << QuicUtils::TagToString(framer_.last_version_tag());
- }
+ QUIC_BUG_IF(!time_wait_list_manager_->IsConnectionIdInTimeWait(
+ current_connection_id_) &&
+ !ShouldCreateSessionForUnknownVersion(framer_.last_version_tag()))
+ << "Unexpected version mismatch: "
+ << QuicUtils::TagToString(framer_.last_version_tag());
// Keep processing after protocol mismatch - this will be dealt with by the
// time wait list or connection that we will create.
« no previous file with comments | « net/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698