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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 void QuicServer::Initialize() { | 66 void QuicServer::Initialize() { |
67 #if MMSG_MORE | 67 #if MMSG_MORE |
68 use_recvmmsg_ = true; | 68 use_recvmmsg_ = true; |
69 #endif | 69 #endif |
70 | 70 |
71 // If an initial flow control window has not explicitly been set, then use a | 71 // If an initial flow control window has not explicitly been set, then use a |
72 // sensible value for a server: 1 MB for session, 64 KB for each stream. | 72 // sensible value for a server: 1 MB for session, 64 KB for each stream. |
73 const uint32 kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB | 73 const uint32 kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB |
74 const uint32 kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB | 74 const uint32 kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB |
75 if (config_.GetInitialFlowControlWindowToSend() == | |
76 kMinimumFlowControlSendWindow) { | |
77 config_.SetInitialFlowControlWindowToSend(kInitialSessionFlowControlWindow); | |
78 } | |
79 if (config_.GetInitialStreamFlowControlWindowToSend() == | 75 if (config_.GetInitialStreamFlowControlWindowToSend() == |
80 kMinimumFlowControlSendWindow) { | 76 kMinimumFlowControlSendWindow) { |
81 config_.SetInitialStreamFlowControlWindowToSend( | 77 config_.SetInitialStreamFlowControlWindowToSend( |
82 kInitialStreamFlowControlWindow); | 78 kInitialStreamFlowControlWindow); |
83 } | 79 } |
84 if (config_.GetInitialSessionFlowControlWindowToSend() == | 80 if (config_.GetInitialSessionFlowControlWindowToSend() == |
85 kMinimumFlowControlSendWindow) { | 81 kMinimumFlowControlSendWindow) { |
86 config_.SetInitialSessionFlowControlWindowToSend( | 82 config_.SetInitialSessionFlowControlWindowToSend( |
87 kInitialSessionFlowControlWindow); | 83 kInitialSessionFlowControlWindow); |
88 } | 84 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 QuicEncryptedPacket packet(buf, bytes_read, false); | 239 QuicEncryptedPacket packet(buf, bytes_read, false); |
244 | 240 |
245 IPEndPoint server_address(server_ip, port); | 241 IPEndPoint server_address(server_ip, port); |
246 processor->ProcessPacket(server_address, client_address, packet); | 242 processor->ProcessPacket(server_address, client_address, packet); |
247 | 243 |
248 return true; | 244 return true; |
249 } | 245 } |
250 | 246 |
251 } // namespace tools | 247 } // namespace tools |
252 } // namespace net | 248 } // namespace net |
OLD | NEW |