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/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 id < stream_id; | 672 id < stream_id; |
673 id += 2) { | 673 id += 2) { |
674 available_streams_.insert(id); | 674 available_streams_.insert(id); |
675 } | 675 } |
676 largest_peer_created_stream_id_ = stream_id; | 676 largest_peer_created_stream_id_ = stream_id; |
677 } | 677 } |
678 if (FLAGS_allow_many_available_streams) { | 678 if (FLAGS_allow_many_available_streams) { |
679 // Check if the new number of open streams would cause the number of | 679 // Check if the new number of open streams would cause the number of |
680 // open streams to exceed the limit. | 680 // open streams to exceed the limit. |
681 if (GetNumOpenStreams() >= get_max_open_streams()) { | 681 if (GetNumOpenStreams() >= get_max_open_streams()) { |
682 CloseConnection(QUIC_TOO_MANY_OPEN_STREAMS); | 682 if (connection()->version() <= QUIC_VERSION_27) { |
| 683 CloseConnection(QUIC_TOO_MANY_OPEN_STREAMS); |
| 684 } else { |
| 685 // Refuse to open the stream. |
| 686 SendRstStream(stream_id, QUIC_REFUSED_STREAM, 0); |
| 687 } |
683 return nullptr; | 688 return nullptr; |
684 } | 689 } |
685 } | 690 } |
686 ReliableQuicStream* stream = CreateIncomingDynamicStream(stream_id); | 691 ReliableQuicStream* stream = CreateIncomingDynamicStream(stream_id); |
687 if (stream == nullptr) { | 692 if (stream == nullptr) { |
688 return nullptr; | 693 return nullptr; |
689 } | 694 } |
690 ActivateStream(stream); | 695 ActivateStream(stream); |
691 return stream; | 696 return stream; |
692 } | 697 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 793 } |
789 for (auto const& kv : dynamic_stream_map_) { | 794 for (auto const& kv : dynamic_stream_map_) { |
790 if (kv.second->flow_controller()->IsBlocked()) { | 795 if (kv.second->flow_controller()->IsBlocked()) { |
791 return true; | 796 return true; |
792 } | 797 } |
793 } | 798 } |
794 return false; | 799 return false; |
795 } | 800 } |
796 | 801 |
797 } // namespace net | 802 } // namespace net |
OLD | NEW |