Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: net/quic/quic_server.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/congestion_control/tcp_receiver.h"
12 #include "net/quic/crypto/crypto_handshake.h" 11 #include "net/quic/crypto/crypto_handshake.h"
13 #include "net/quic/crypto/quic_random.h" 12 #include "net/quic/crypto/quic_random.h"
14 #include "net/quic/quic_crypto_stream.h" 13 #include "net/quic/quic_crypto_stream.h"
15 #include "net/quic/quic_data_reader.h" 14 #include "net/quic/quic_data_reader.h"
16 #include "net/quic/quic_dispatcher.h" 15 #include "net/quic/quic_dispatcher.h"
17 #include "net/quic/quic_in_memory_cache.h" 16 #include "net/quic/quic_in_memory_cache.h"
18 #include "net/quic/quic_protocol.h" 17 #include "net/quic/quic_protocol.h"
19 #include "net/quic/quic_server_packet_writer.h" 18 #include "net/quic/quic_server_packet_writer.h"
20 #include "net/udp/udp_server_socket.h" 19 #include "net/udp/udp_server_socket.h"
21 20
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 int rc = socket->Listen(address); 86 int rc = socket->Listen(address);
88 if (rc < 0) { 87 if (rc < 0) {
89 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc); 88 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc);
90 return rc; 89 return rc;
91 } 90 }
92 91
93 // These send and receive buffer sizes are sized for a single connection, 92 // These send and receive buffer sizes are sized for a single connection,
94 // because the default usage of QuicServer is as a test server with one or 93 // because the default usage of QuicServer is as a test server with one or
95 // two clients. Adjust higher for use with many clients. 94 // two clients. Adjust higher for use with many clients.
96 rc = socket->SetReceiveBufferSize( 95 rc = socket->SetReceiveBufferSize(
97 static_cast<int32>(TcpReceiver::kReceiveWindowTCP)); 96 static_cast<int32>(kDefaultSocketReceiveBuffer));
98 if (rc < 0) { 97 if (rc < 0) {
99 LOG(ERROR) << "SetReceiveBufferSize() failed: " << ErrorToString(rc); 98 LOG(ERROR) << "SetReceiveBufferSize() failed: " << ErrorToString(rc);
100 return rc; 99 return rc;
101 } 100 }
102 101
103 rc = socket->SetSendBufferSize(20 * kMaxPacketSize); 102 rc = socket->SetSendBufferSize(20 * kMaxPacketSize);
104 if (rc < 0) { 103 if (rc < 0) {
105 LOG(ERROR) << "SetSendBufferSize() failed: " << ErrorToString(rc); 104 LOG(ERROR) << "SetSendBufferSize() failed: " << ErrorToString(rc);
106 return rc; 105 return rc;
107 } 106 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return; 182 return;
184 } 183 }
185 184
186 QuicEncryptedPacket packet(read_buffer_->data(), result, false); 185 QuicEncryptedPacket packet(read_buffer_->data(), result, false);
187 dispatcher_->ProcessPacket(server_address_, client_address_, packet); 186 dispatcher_->ProcessPacket(server_address_, client_address_, packet);
188 187
189 StartReading(); 188 StartReading();
190 } 189 }
191 190
192 } // namespace net 191 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698