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

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

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/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server.cc
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 11eba67ef3877b627c168e8cf3abb35eb25a6f3a..dadb49b381b3a7c35410e24581e0c65b0ee0d8fe 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -48,6 +48,8 @@ const char kSourceAddressTokenSecret[] = "secret";
} // namespace
+const size_t kNumSessionsToCreatePerSocketEvent = 16;
+
QuicServer::QuicServer(std::unique_ptr<ProofSource> proof_source)
: QuicServer(std::move(proof_source),
QuicConfig(),
@@ -177,6 +179,12 @@ void QuicServer::OnEvent(int fd, EpollEvent* event) {
if (event->in_events & EPOLLIN) {
DVLOG(1) << "EPOLLIN";
+
+ if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop &&
+ FLAGS_quic_buffer_packet_till_chlo) {
+ dispatcher_->ProcessBufferedChlos(kNumSessionsToCreatePerSocketEvent);
+ }
+
bool more_to_read = true;
while (more_to_read) {
more_to_read = packet_reader_->ReadAndDispatchPackets(
@@ -184,6 +192,12 @@ void QuicServer::OnEvent(int fd, EpollEvent* event) {
QuicEpollClock(&epoll_server_), dispatcher_.get(),
overflow_supported_ ? &packets_dropped_ : nullptr);
}
+
+ if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop &&
+ FLAGS_quic_buffer_packet_till_chlo && dispatcher_->HasChlosBuffered()) {
+ // Register EPOLLIN event to consume buffered CHLO(s).
+ event->out_ready_mask |= EPOLLIN;
+ }
}
if (event->in_events & EPOLLOUT) {
dispatcher_->OnCanWrite();
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698