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

Side by Side Diff: net/tools/quic/quic_server_session.cc

Issue 557363003: Allow number of open QUIC streams to grow 10% beyond configured limit at (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change_initial_RTT_estimate_75389539
Patch Set: Created 6 years, 3 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_session.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('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 (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_session.h" 5 #include "net/tools/quic/quic_server_session.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/crypto/source_address_token.h" 8 #include "net/quic/crypto/source_address_token.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { 139 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) {
140 if (id % 2 == 0) { 140 if (id % 2 == 0) {
141 DVLOG(1) << "Invalid incoming even stream_id:" << id; 141 DVLOG(1) << "Invalid incoming even stream_id:" << id;
142 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); 142 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID);
143 return false; 143 return false;
144 } 144 }
145 if (GetNumOpenStreams() >= get_max_open_streams()) { 145 if (GetNumOpenStreams() >= get_max_open_streams()) {
146 DVLOG(1) << "Failed to create a new incoming stream with id:" << id 146 DVLOG(1) << "Failed to create a new incoming stream with id:" << id
147 << " Already " << GetNumOpenStreams() << " open."; 147 << " Already " << GetNumOpenStreams() << " streams open (max "
148 << get_max_open_streams() << ").";
148 connection()->SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS); 149 connection()->SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS);
149 return false; 150 return false;
150 } 151 }
151 return true; 152 return true;
152 } 153 }
153 154
154 QuicDataStream* QuicServerSession::CreateIncomingDataStream( 155 QuicDataStream* QuicServerSession::CreateIncomingDataStream(
155 QuicStreamId id) { 156 QuicStreamId id) {
156 if (!ShouldCreateIncomingDataStream(id)) { 157 if (!ShouldCreateIncomingDataStream(id)) {
157 return NULL; 158 return NULL;
158 } 159 }
159 160
160 return new QuicSpdyServerStream(id, this); 161 return new QuicSpdyServerStream(id, this);
161 } 162 }
162 163
163 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() { 164 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() {
164 DLOG(ERROR) << "Server push not yet supported"; 165 DLOG(ERROR) << "Server push not yet supported";
165 return NULL; 166 return NULL;
166 } 167 }
167 168
168 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { 169 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() {
169 return crypto_stream_.get(); 170 return crypto_stream_.get();
170 } 171 }
171 172
172 } // namespace tools 173 } // namespace tools
173 } // namespace net 174 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698