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 10 matching lines...) Expand all Loading... |
21 #include "net/tools/quic/quic_in_memory_cache.h" | 21 #include "net/tools/quic/quic_in_memory_cache.h" |
22 #include "net/tools/quic/quic_socket_utils.h" | 22 #include "net/tools/quic/quic_socket_utils.h" |
23 | 23 |
24 #define MMSG_MORE 0 | 24 #define MMSG_MORE 0 |
25 | 25 |
26 #ifndef SO_RXQ_OVFL | 26 #ifndef SO_RXQ_OVFL |
27 #define SO_RXQ_OVFL 40 | 27 #define SO_RXQ_OVFL 40 |
28 #endif | 28 #endif |
29 | 29 |
30 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; | 30 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; |
31 const int kNumPacketsPerReadCall = 5; // Arbitrary | |
32 static const char kSourceAddressTokenSecret[] = "secret"; | 31 static const char kSourceAddressTokenSecret[] = "secret"; |
33 | 32 |
34 namespace net { | 33 namespace net { |
35 namespace tools { | 34 namespace tools { |
36 | 35 |
37 QuicServer::QuicServer() | 36 QuicServer::QuicServer() |
38 : port_(0), | 37 : port_(0), |
39 fd_(-1), | 38 fd_(-1), |
40 packets_dropped_(0), | 39 packets_dropped_(0), |
41 overflow_supported_(false), | 40 overflow_supported_(false), |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 QuicEncryptedPacket packet(buf, bytes_read, false); | 218 QuicEncryptedPacket packet(buf, bytes_read, false); |
220 | 219 |
221 IPEndPoint server_address(server_ip, port); | 220 IPEndPoint server_address(server_ip, port); |
222 MaybeDispatchPacket(dispatcher, packet, server_address, client_address); | 221 MaybeDispatchPacket(dispatcher, packet, server_address, client_address); |
223 | 222 |
224 return true; | 223 return true; |
225 } | 224 } |
226 | 225 |
227 } // namespace tools | 226 } // namespace tools |
228 } // namespace net | 227 } // namespace net |
OLD | NEW |