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_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/proto/cached_network_parameters.pb.h" | 8 #include "net/quic/proto/cached_network_parameters.pb.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 bool QuicServerSession::ShouldCreateIncomingDynamicStream(QuicStreamId id) { | 185 bool QuicServerSession::ShouldCreateIncomingDynamicStream(QuicStreamId id) { |
186 if (!connection()->connected()) { | 186 if (!connection()->connected()) { |
187 LOG(DFATAL) << "ShouldCreateIncomingDynamicStream called when disconnected"; | 187 LOG(DFATAL) << "ShouldCreateIncomingDynamicStream called when disconnected"; |
188 return false; | 188 return false; |
189 } | 189 } |
190 | 190 |
191 if (id % 2 == 0) { | 191 if (id % 2 == 0) { |
192 DVLOG(1) << "Invalid incoming even stream_id:" << id; | 192 DVLOG(1) << "Invalid incoming even stream_id:" << id; |
193 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); | 193 connection()->SendConnectionCloseWithDetails( |
| 194 QUIC_INVALID_STREAM_ID, "Client created even numbered stream"); |
194 return false; | 195 return false; |
195 } | 196 } |
196 return true; | 197 return true; |
197 } | 198 } |
198 | 199 |
199 QuicSpdyStream* QuicServerSession::CreateIncomingDynamicStream( | 200 QuicSpdyStream* QuicServerSession::CreateIncomingDynamicStream( |
200 QuicStreamId id) { | 201 QuicStreamId id) { |
201 if (!ShouldCreateIncomingDynamicStream(id)) { | 202 if (!ShouldCreateIncomingDynamicStream(id)) { |
202 return nullptr; | 203 return nullptr; |
203 } | 204 } |
(...skipping 30 matching lines...) Expand all Loading... |
234 ActivateStream(stream); | 235 ActivateStream(stream); |
235 return stream; | 236 return stream; |
236 } | 237 } |
237 | 238 |
238 QuicCryptoServerStreamBase* QuicServerSession::GetCryptoStream() { | 239 QuicCryptoServerStreamBase* QuicServerSession::GetCryptoStream() { |
239 return crypto_stream_.get(); | 240 return crypto_stream_.get(); |
240 } | 241 } |
241 | 242 |
242 } // namespace tools | 243 } // namespace tools |
243 } // namespace net | 244 } // namespace net |
OLD | NEW |