| 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 26 matching lines...) Expand all Loading... |
| 37 : port_(0), | 37 : port_(0), |
| 38 fd_(-1), | 38 fd_(-1), |
| 39 packets_dropped_(0), | 39 packets_dropped_(0), |
| 40 overflow_supported_(false), | 40 overflow_supported_(false), |
| 41 use_recvmmsg_(false), | 41 use_recvmmsg_(false), |
| 42 crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()), | 42 crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()), |
| 43 supported_versions_(QuicSupportedVersions()) { | 43 supported_versions_(QuicSupportedVersions()) { |
| 44 // Use hardcoded crypto parameters for now. | 44 // Use hardcoded crypto parameters for now. |
| 45 config_.SetDefaults(); | 45 config_.SetDefaults(); |
| 46 config_.set_initial_round_trip_time_us(kMaxInitialRoundTripTimeUs, 0); | 46 config_.set_initial_round_trip_time_us(kMaxInitialRoundTripTimeUs, 0); |
| 47 config_.set_server_initial_congestion_window(kMaxInitialWindow, |
| 48 kDefaultInitialWindow); |
| 47 Initialize(); | 49 Initialize(); |
| 48 } | 50 } |
| 49 | 51 |
| 50 QuicServer::QuicServer(const QuicConfig& config, | 52 QuicServer::QuicServer(const QuicConfig& config, |
| 51 const QuicVersionVector& supported_versions) | 53 const QuicVersionVector& supported_versions) |
| 52 : port_(0), | 54 : port_(0), |
| 53 fd_(-1), | 55 fd_(-1), |
| 54 packets_dropped_(0), | 56 packets_dropped_(0), |
| 55 overflow_supported_(false), | 57 overflow_supported_(false), |
| 56 use_recvmmsg_(false), | 58 use_recvmmsg_(false), |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 QuicEncryptedPacket packet(buf, bytes_read, false); | 228 QuicEncryptedPacket packet(buf, bytes_read, false); |
| 227 | 229 |
| 228 IPEndPoint server_address(server_ip, port); | 230 IPEndPoint server_address(server_ip, port); |
| 229 MaybeDispatchPacket(dispatcher, packet, server_address, client_address); | 231 MaybeDispatchPacket(dispatcher, packet, server_address, client_address); |
| 230 | 232 |
| 231 return true; | 233 return true; |
| 232 } | 234 } |
| 233 | 235 |
| 234 } // namespace tools | 236 } // namespace tools |
| 235 } // namespace net | 237 } // namespace net |
| OLD | NEW |