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

Side by Side Diff: net/tools/quic/quic_server.cc

Issue 2487613002: Landing Recent QUIC changes until 12:43 PM, Nov 5, 2016 UTC+8 (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_packet_writer_wrapper.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_server.h" 5 #include "net/tools/quic/quic_server.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <features.h> 8 #include <features.h>
9 #include <netinet/in.h> 9 #include <netinet/in.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 fd_ = -1; 173 fd_ = -1;
174 } 174 }
175 175
176 void QuicServer::OnEvent(int fd, EpollEvent* event) { 176 void QuicServer::OnEvent(int fd, EpollEvent* event) {
177 DCHECK_EQ(fd, fd_); 177 DCHECK_EQ(fd, fd_);
178 event->out_ready_mask = 0; 178 event->out_ready_mask = 0;
179 179
180 if (event->in_events & EPOLLIN) { 180 if (event->in_events & EPOLLIN) {
181 DVLOG(1) << "EPOLLIN"; 181 DVLOG(1) << "EPOLLIN";
182 182
183 if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop && 183 if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop) {
184 FLAGS_quic_buffer_packet_till_chlo) {
185 dispatcher_->ProcessBufferedChlos(kNumSessionsToCreatePerSocketEvent); 184 dispatcher_->ProcessBufferedChlos(kNumSessionsToCreatePerSocketEvent);
186 } 185 }
187 186
188 bool more_to_read = true; 187 bool more_to_read = true;
189 while (more_to_read) { 188 while (more_to_read) {
190 more_to_read = packet_reader_->ReadAndDispatchPackets( 189 more_to_read = packet_reader_->ReadAndDispatchPackets(
191 fd_, port_, QuicEpollClock(&epoll_server_), dispatcher_.get(), 190 fd_, port_, QuicEpollClock(&epoll_server_), dispatcher_.get(),
192 overflow_supported_ ? &packets_dropped_ : nullptr); 191 overflow_supported_ ? &packets_dropped_ : nullptr);
193 } 192 }
194 193
195 if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop && 194 if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop &&
196 FLAGS_quic_buffer_packet_till_chlo && dispatcher_->HasChlosBuffered()) { 195 dispatcher_->HasChlosBuffered()) {
197 // Register EPOLLIN event to consume buffered CHLO(s). 196 // Register EPOLLIN event to consume buffered CHLO(s).
198 event->out_ready_mask |= EPOLLIN; 197 event->out_ready_mask |= EPOLLIN;
199 } 198 }
200 } 199 }
201 if (event->in_events & EPOLLOUT) { 200 if (event->in_events & EPOLLOUT) {
202 dispatcher_->OnCanWrite(); 201 dispatcher_->OnCanWrite();
203 if (dispatcher_->HasPendingWrites()) { 202 if (dispatcher_->HasPendingWrites()) {
204 event->out_ready_mask |= EPOLLOUT; 203 event->out_ready_mask |= EPOLLOUT;
205 } 204 }
206 } 205 }
207 if (event->in_events & EPOLLERR) { 206 if (event->in_events & EPOLLERR) {
208 } 207 }
209 } 208 }
210 209
211 } // namespace net 210 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_packet_writer_wrapper.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698