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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.cc ('k') | net/quic/quic_session.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"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 int rc = socket->Listen(address); 68 int rc = socket->Listen(address);
69 if (rc < 0) { 69 if (rc < 0) {
70 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc); 70 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc);
71 return rc; 71 return rc;
72 } 72 }
73 73
74 // These send and receive buffer sizes are sized for a single connection, 74 // These send and receive buffer sizes are sized for a single connection,
75 // because the default usage of QuicServer is as a test server with one or 75 // because the default usage of QuicServer is as a test server with one or
76 // two clients. Adjust higher for use with many clients. 76 // two clients. Adjust higher for use with many clients.
77 rc = socket->SetReceiveBufferSize(TcpReceiver::kReceiveWindowTCP); 77 rc = socket->SetReceiveBufferSize(
78 static_cast<int32>(TcpReceiver::kReceiveWindowTCP));
78 if (rc < 0) { 79 if (rc < 0) {
79 LOG(ERROR) << "SetReceiveBufferSize() failed: " << ErrorToString(rc); 80 LOG(ERROR) << "SetReceiveBufferSize() failed: " << ErrorToString(rc);
80 return rc; 81 return rc;
81 } 82 }
82 83
83 rc = socket->SetSendBufferSize(20 * kMaxPacketSize); 84 rc = socket->SetSendBufferSize(20 * kMaxPacketSize);
84 if (rc < 0) { 85 if (rc < 0) {
85 LOG(ERROR) << "SetSendBufferSize() failed: " << ErrorToString(rc); 86 LOG(ERROR) << "SetSendBufferSize() failed: " << ErrorToString(rc);
86 return rc; 87 return rc;
87 } 88 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return; 164 return;
164 } 165 }
165 166
166 QuicEncryptedPacket packet(read_buffer_->data(), result, false); 167 QuicEncryptedPacket packet(read_buffer_->data(), result, false);
167 dispatcher_->ProcessPacket(server_address_, client_address_, packet); 168 dispatcher_->ProcessPacket(server_address_, client_address_, packet);
168 169
169 StartReading(); 170 StartReading();
170 } 171 }
171 172
172 } // namespace net 173 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698