| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_server.h" | 5 #include "net/quic/quic_server.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/quic/crypto/crypto_handshake.h" | 11 #include "net/quic/crypto/crypto_handshake.h" |
| 12 #include "net/quic/crypto/quic_random.h" | 12 #include "net/quic/crypto/quic_random.h" |
| 13 #include "net/quic/quic_crypto_stream.h" | 13 #include "net/quic/quic_crypto_stream.h" |
| 14 #include "net/quic/quic_data_reader.h" | 14 #include "net/quic/quic_data_reader.h" |
| 15 #include "net/quic/quic_dispatcher.h" | 15 #include "net/quic/quic_dispatcher.h" |
| 16 #include "net/quic/quic_in_memory_cache.h" | |
| 17 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_protocol.h" |
| 18 #include "net/quic/quic_server_packet_writer.h" | 17 #include "net/quic/quic_server_packet_writer.h" |
| 19 #include "net/udp/udp_server_socket.h" | 18 #include "net/udp/udp_server_socket.h" |
| 20 | 19 |
| 21 namespace net { | 20 namespace net { |
| 22 | 21 |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 const char kSourceAddressTokenSecret[] = "secret"; | 24 const char kSourceAddressTokenSecret[] = "secret"; |
| 26 | 25 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 kMinimumFlowControlSendWindow) { | 57 kMinimumFlowControlSendWindow) { |
| 59 config_.SetInitialStreamFlowControlWindowToSend( | 58 config_.SetInitialStreamFlowControlWindowToSend( |
| 60 kInitialStreamFlowControlWindow); | 59 kInitialStreamFlowControlWindow); |
| 61 } | 60 } |
| 62 if (config_.GetInitialSessionFlowControlWindowToSend() == | 61 if (config_.GetInitialSessionFlowControlWindowToSend() == |
| 63 kMinimumFlowControlSendWindow) { | 62 kMinimumFlowControlSendWindow) { |
| 64 config_.SetInitialSessionFlowControlWindowToSend( | 63 config_.SetInitialSessionFlowControlWindowToSend( |
| 65 kInitialSessionFlowControlWindow); | 64 kInitialSessionFlowControlWindow); |
| 66 } | 65 } |
| 67 | 66 |
| 68 // Initialize the in memory cache now. | |
| 69 QuicInMemoryCache::GetInstance(); | |
| 70 | |
| 71 scoped_ptr<CryptoHandshakeMessage> scfg( | 67 scoped_ptr<CryptoHandshakeMessage> scfg( |
| 72 crypto_config_.AddDefaultConfig( | 68 crypto_config_.AddDefaultConfig( |
| 73 helper_.GetRandomGenerator(), helper_.GetClock(), | 69 helper_.GetRandomGenerator(), helper_.GetClock(), |
| 74 QuicCryptoServerConfig::ConfigOptions())); | 70 QuicCryptoServerConfig::ConfigOptions())); |
| 75 } | 71 } |
| 76 | 72 |
| 77 QuicServer::~QuicServer() { | 73 QuicServer::~QuicServer() { |
| 78 } | 74 } |
| 79 | 75 |
| 80 int QuicServer::Listen(const IPEndPoint& address) { | 76 int QuicServer::Listen(const IPEndPoint& address) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return; | 178 return; |
| 183 } | 179 } |
| 184 | 180 |
| 185 QuicEncryptedPacket packet(read_buffer_->data(), result, false); | 181 QuicEncryptedPacket packet(read_buffer_->data(), result, false); |
| 186 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 182 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
| 187 | 183 |
| 188 StartReading(); | 184 StartReading(); |
| 189 } | 185 } |
| 190 | 186 |
| 191 } // namespace net | 187 } // namespace net |
| OLD | NEW |