OLD | NEW |
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void QuicServer::OnEvent(int fd, EpollEvent* event) { | 186 void QuicServer::OnEvent(int fd, EpollEvent* event) { |
187 DCHECK_EQ(fd, fd_); | 187 DCHECK_EQ(fd, fd_); |
188 event->out_ready_mask = 0; | 188 event->out_ready_mask = 0; |
189 | 189 |
190 if (event->in_events & EPOLLIN) { | 190 if (event->in_events & EPOLLIN) { |
191 DVLOG(1) << "EPOLLIN"; | 191 DVLOG(1) << "EPOLLIN"; |
192 bool read = true; | 192 bool read = true; |
193 while (read) { | 193 while (read) { |
194 read = ReadAndDispatchSinglePacket( | 194 read = ReadAndDispatchSinglePacket( |
195 fd_, port_, dispatcher_.get(), | 195 fd_, port_, dispatcher_.get(), |
196 overflow_supported_ ? &packets_dropped_ : NULL); | 196 overflow_supported_ ? &packets_dropped_ : nullptr); |
197 } | 197 } |
198 } | 198 } |
199 if (event->in_events & EPOLLOUT) { | 199 if (event->in_events & EPOLLOUT) { |
200 dispatcher_->OnCanWrite(); | 200 dispatcher_->OnCanWrite(); |
201 if (dispatcher_->HasPendingWrites()) { | 201 if (dispatcher_->HasPendingWrites()) { |
202 event->out_ready_mask |= EPOLLOUT; | 202 event->out_ready_mask |= EPOLLOUT; |
203 } | 203 } |
204 } | 204 } |
205 if (event->in_events & EPOLLERR) { | 205 if (event->in_events & EPOLLERR) { |
206 } | 206 } |
(...skipping 22 matching lines...) Expand all Loading... |
229 QuicEncryptedPacket packet(buf, bytes_read, false); | 229 QuicEncryptedPacket packet(buf, bytes_read, false); |
230 | 230 |
231 IPEndPoint server_address(server_ip, port); | 231 IPEndPoint server_address(server_ip, port); |
232 processor->ProcessPacket(server_address, client_address, packet); | 232 processor->ProcessPacket(server_address, client_address, packet); |
233 | 233 |
234 return true; | 234 return true; |
235 } | 235 } |
236 | 236 |
237 } // namespace tools | 237 } // namespace tools |
238 } // namespace net | 238 } // namespace net |
OLD | NEW |