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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Initialize the in memory cache now. | 44 // Initialize the in memory cache now. |
45 QuicInMemoryCache::GetInstance(); | 45 QuicInMemoryCache::GetInstance(); |
46 | 46 |
47 // Use hardcoded crypto parameters for now. | 47 // Use hardcoded crypto parameters for now. |
48 config_.SetDefaults(); | 48 config_.SetDefaults(); |
49 CryptoHandshakeMessage extra_tags; | 49 CryptoHandshakeMessage extra_tags; |
50 config_.ToHandshakeMessage(&extra_tags); | 50 config_.ToHandshakeMessage(&extra_tags); |
51 QuicEpollClock clock(&epoll_server_); | 51 QuicEpollClock clock(&epoll_server_); |
52 | 52 |
53 scoped_ptr<CryptoHandshakeMessage> scfg( | 53 scoped_ptr<CryptoHandshakeMessage> scfg( |
54 crypto_config_.AddDefaultConfig(QuicRandom::GetInstance(), &clock, | 54 crypto_config_.AddDefaultConfig( |
55 extra_tags)); | 55 QuicRandom::GetInstance(), &clock, extra_tags, |
| 56 QuicCryptoServerConfig::kDefaultExpiry)); |
56 // If we were using the same config in many servers then we would have to | 57 // If we were using the same config in many servers then we would have to |
57 // parse a QuicConfig from config_tags here. | 58 // parse a QuicConfig from config_tags here. |
58 if (!config_.SetFromHandshakeMessage(*scfg)) { | 59 if (!config_.SetFromHandshakeMessage(*scfg)) { |
59 CHECK(false) << "Crypto config could not be parsed by QuicConfig."; | 60 CHECK(false) << "Crypto config could not be parsed by QuicConfig."; |
60 } | 61 } |
61 } | 62 } |
62 | 63 |
63 QuicServer::~QuicServer() { | 64 QuicServer::~QuicServer() { |
64 } | 65 } |
65 | 66 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 199 } |
199 | 200 |
200 IPEndPoint server_address(server_ip, port); | 201 IPEndPoint server_address(server_ip, port); |
201 dispatcher->ProcessPacket(server_address, client_address, guid, packet); | 202 dispatcher->ProcessPacket(server_address, client_address, guid, packet); |
202 | 203 |
203 return true; | 204 return true; |
204 } | 205 } |
205 | 206 |
206 } // namespace tools | 207 } // namespace tools |
207 } // namespace net | 208 } // namespace net |
OLD | NEW |