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/quic/quic_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/crypto/proof_verifier.h" | 8 #include "net/quic/crypto/proof_verifier.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/ssl/ssl_info.h" | 10 #include "net/ssl/ssl_info.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 return NULL; | 421 return NULL; |
422 } | 422 } |
423 | 423 |
424 implicitly_created_streams_.erase(stream_id); | 424 implicitly_created_streams_.erase(stream_id); |
425 if (stream_id > largest_peer_created_stream_id_) { | 425 if (stream_id > largest_peer_created_stream_id_) { |
426 // TODO(rch) add unit test for this | 426 // TODO(rch) add unit test for this |
427 if (stream_id - largest_peer_created_stream_id_ > kMaxStreamIdDelta) { | 427 if (stream_id - largest_peer_created_stream_id_ > kMaxStreamIdDelta) { |
428 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); | 428 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); |
429 return NULL; | 429 return NULL; |
430 } | 430 } |
431 if (largest_peer_created_stream_id_ != 0) { | 431 if (largest_peer_created_stream_id_ == 0) { |
432 for (QuicStreamId id = largest_peer_created_stream_id_ + 2; | 432 largest_peer_created_stream_id_= 1; |
433 id < stream_id; | 433 } |
434 id += 2) { | 434 for (QuicStreamId id = largest_peer_created_stream_id_ + 2; |
435 implicitly_created_streams_.insert(id); | 435 id < stream_id; |
436 } | 436 id += 2) { |
| 437 implicitly_created_streams_.insert(id); |
437 } | 438 } |
438 largest_peer_created_stream_id_ = stream_id; | 439 largest_peer_created_stream_id_ = stream_id; |
439 } | 440 } |
440 ReliableQuicStream* stream = CreateIncomingReliableStream(stream_id); | 441 ReliableQuicStream* stream = CreateIncomingReliableStream(stream_id); |
441 if (stream == NULL) { | 442 if (stream == NULL) { |
442 return NULL; | 443 return NULL; |
443 } | 444 } |
444 ActivateStream(stream); | 445 ActivateStream(stream); |
445 return stream; | 446 return stream; |
446 } | 447 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 NOTIMPLEMENTED(); | 487 NOTIMPLEMENTED(); |
487 return false; | 488 return false; |
488 } | 489 } |
489 | 490 |
490 void QuicSession::PostProcessAfterData() { | 491 void QuicSession::PostProcessAfterData() { |
491 STLDeleteElements(&closed_streams_); | 492 STLDeleteElements(&closed_streams_); |
492 closed_streams_.clear(); | 493 closed_streams_.clear(); |
493 } | 494 } |
494 | 495 |
495 } // namespace net | 496 } // namespace net |
OLD | NEW |