| 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 29 matching lines...) Expand all Loading... |
| 40 // Specifies the directory used during QuicInMemoryCache | 40 // Specifies the directory used during QuicInMemoryCache |
| 41 // construction to seed the cache. Cache directory can be | 41 // construction to seed the cache. Cache directory can be |
| 42 // generated using `wget -p --save-headers <url>` | 42 // generated using `wget -p --save-headers <url>` |
| 43 std::string FLAGS_quic_in_memory_cache_dir = ""; | 43 std::string FLAGS_quic_in_memory_cache_dir = ""; |
| 44 | 44 |
| 45 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; | 45 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; |
| 46 const char kSourceAddressTokenSecret[] = "secret"; | 46 const char kSourceAddressTokenSecret[] = "secret"; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 QuicServer::QuicServer() : QuicServer(QuicConfig(), QuicSupportedVersions()) {} | 50 QuicServer::QuicServer(ProofSource* proof_source) |
| 51 : QuicServer(proof_source, QuicConfig(), QuicSupportedVersions()) {} |
| 51 | 52 |
| 52 QuicServer::QuicServer(const QuicConfig& config, | 53 QuicServer::QuicServer(ProofSource* proof_source, |
| 54 const QuicConfig& config, |
| 53 const QuicVersionVector& supported_versions) | 55 const QuicVersionVector& supported_versions) |
| 54 : port_(0), | 56 : port_(0), |
| 55 fd_(-1), | 57 fd_(-1), |
| 56 packets_dropped_(0), | 58 packets_dropped_(0), |
| 57 overflow_supported_(false), | 59 overflow_supported_(false), |
| 58 use_recvmmsg_(false), | 60 use_recvmmsg_(false), |
| 59 config_(config), | 61 config_(config), |
| 60 crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()), | 62 crypto_config_(kSourceAddressTokenSecret, |
| 63 QuicRandom::GetInstance(), |
| 64 proof_source), |
| 61 supported_versions_(supported_versions), | 65 supported_versions_(supported_versions), |
| 62 packet_reader_(new QuicPacketReader()) { | 66 packet_reader_(new QuicPacketReader()) { |
| 63 Initialize(); | 67 Initialize(); |
| 64 } | 68 } |
| 65 | 69 |
| 66 void QuicServer::Initialize() { | 70 void QuicServer::Initialize() { |
| 67 #if MMSG_MORE | 71 #if MMSG_MORE |
| 68 use_recvmmsg_ = true; | 72 use_recvmmsg_ = true; |
| 69 #endif | 73 #endif |
| 70 | 74 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (dispatcher_->HasPendingWrites()) { | 227 if (dispatcher_->HasPendingWrites()) { |
| 224 event->out_ready_mask |= EPOLLOUT; | 228 event->out_ready_mask |= EPOLLOUT; |
| 225 } | 229 } |
| 226 } | 230 } |
| 227 if (event->in_events & EPOLLERR) { | 231 if (event->in_events & EPOLLERR) { |
| 228 } | 232 } |
| 229 } | 233 } |
| 230 | 234 |
| 231 } // namespace tools | 235 } // namespace tools |
| 232 } // namespace net | 236 } // namespace net |
| OLD | NEW |