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

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

Issue 2310543002: Limits only 16 new QUIC connections can be opened per epoll event. (Closed)
Patch Set: Limits only 16 new QUIC connections can be opened per epoll event. Created 4 years, 3 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/end_to_end_test.cc ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.h
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index ab3296f0715ffd1864f9892f40cd1ad0c25b476f..33d8777d3afef6df56f991c733ea48b1c1a0fd7c 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -146,6 +146,12 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
QuicBufferedPacketStore::BufferedPacketList
early_arrived_packets) override;
+ // Create connections for previously buffered CHLOs as many as allowed.
+ virtual void ProcessBufferedChlos(size_t max_connections_to_create);
+
+ // Return true if there is CHLO buffered.
+ virtual bool HasChlosBuffered() const;
+
protected:
virtual QuicServerSessionBase* CreateQuicSession(
QuicConnectionId connection_id,
@@ -277,6 +283,11 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
const std::list<QuicBufferedPacketStore::BufferedPacket>& packets,
QuicServerSessionBase* session);
+ void set_new_sessions_allowed_per_event_loop(
+ int16_t new_sessions_allowed_per_event_loop) {
+ new_sessions_allowed_per_event_loop_ = new_sessions_allowed_per_event_loop;
+ }
+
const QuicConfig& config_;
const QuicCryptoServerConfig* crypto_config_;
@@ -329,6 +340,10 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
// framer_visitor_->OnError().
QuicErrorCode last_error_;
+ // A backward counter of how many new sessions can be create within current
+ // event loop. When reaches 0, it means can't create sessions for now.
+ int16_t new_sessions_allowed_per_event_loop_;
+
DISALLOW_COPY_AND_ASSIGN(QuicDispatcher);
};
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698