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

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

Issue 2808273006: Landing Recent QUIC changes until Sun Apr 9 16:12:55 (Closed)
Patch Set: increment enabled_options in e2e test Created 3 years, 8 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 bd691ce2dad989bfb5f40b896617d65e186579d2..23373d00aa9b1cafdf005e70e79e18851fe02ce6 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -211,7 +211,8 @@ QuicDispatcher::QuicDispatcher(
/*unused*/ QuicTime::Zero(),
Perspective::IS_SERVER),
last_error_(QUIC_NO_ERROR),
- new_sessions_allowed_per_event_loop_(0u) {
+ new_sessions_allowed_per_event_loop_(0u),
+ accept_new_connections_(true) {
framer_.set_visitor(this);
}
@@ -363,7 +364,7 @@ void QuicDispatcher::ProcessUnauthenticatedHeaderFate(
QuicPacketNumber packet_number) {
switch (fate) {
case kFateProcess: {
- ProcessChlo();
+ ProcessChlo(packet_number);
break;
}
case kFateTimeWait:
@@ -449,6 +450,10 @@ void QuicDispatcher::CleanUpSession(SessionMap::iterator it,
session_map_.erase(it);
}
+void QuicDispatcher::StopAcceptingNewConnections() {
+ accept_new_connections_ = false;
+}
+
void QuicDispatcher::DeleteSessions() {
closed_session_list_.clear();
}
@@ -710,7 +715,19 @@ void QuicDispatcher::BufferEarlyPacket(QuicConnectionId connection_id) {
}
}
-void QuicDispatcher::ProcessChlo() {
+void QuicDispatcher::ProcessChlo(QuicPacketNumber packet_number) {
+ if (!accept_new_connections_) {
+ // Don't any create new connection.
+ time_wait_list_manager()->AddConnectionIdToTimeWait(
+ current_connection_id(), framer()->version(),
+ /*connection_rejected_statelessly=*/false,
+ /*termination_packets=*/nullptr);
+ // This will trigger sending Public Reset packet.
+ time_wait_list_manager()->ProcessPacket(
+ current_server_address(), current_client_address(),
+ current_connection_id(), packet_number, current_packet());
+ return;
+ }
if (FLAGS_quic_reloadable_flag_quic_create_session_after_insertion &&
!buffered_packets_.HasBufferedPackets(current_connection_id_) &&
!ShouldCreateOrBufferPacketForConnection(current_connection_id_)) {
« 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