| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // when FIN/RSTs for old streams are lost or arrive out of order. | 480 // when FIN/RSTs for old streams are lost or arrive out of order. |
| 481 // Use a minimum number of additional streams, or a percentage increase, | 481 // Use a minimum number of additional streams, or a percentage increase, |
| 482 // whichever is larger. | 482 // whichever is larger. |
| 483 max_streams = | 483 max_streams = |
| 484 max(max_streams + kMaxStreamsMinimumIncrement, | 484 max(max_streams + kMaxStreamsMinimumIncrement, |
| 485 static_cast<uint32>(max_streams * kMaxStreamsMultiplier)); | 485 static_cast<uint32>(max_streams * kMaxStreamsMultiplier)); |
| 486 } | 486 } |
| 487 set_max_open_streams(max_streams); | 487 set_max_open_streams(max_streams); |
| 488 } | 488 } |
| 489 | 489 |
| 490 if (version <= QUIC_VERSION_16) { | |
| 491 return; | |
| 492 } | |
| 493 | |
| 494 if (version <= QUIC_VERSION_19) { | 490 if (version <= QUIC_VERSION_19) { |
| 495 // QUIC_VERSION_17,18,19 don't support independent stream/session flow | 491 // QUIC_VERSION_17,18,19 don't support independent stream/session flow |
| 496 // control windows. | 492 // control windows. |
| 497 if (config_.HasReceivedInitialFlowControlWindowBytes()) { | 493 if (config_.HasReceivedInitialFlowControlWindowBytes()) { |
| 498 // Streams which were created before the SHLO was received (0-RTT | 494 // Streams which were created before the SHLO was received (0-RTT |
| 499 // requests) are now informed of the peer's initial flow control window. | 495 // requests) are now informed of the peer's initial flow control window. |
| 500 uint32 new_window = config_.ReceivedInitialFlowControlWindowBytes(); | 496 uint32 new_window = config_.ReceivedInitialFlowControlWindowBytes(); |
| 501 OnNewStreamFlowControlWindow(new_window); | 497 OnNewStreamFlowControlWindow(new_window); |
| 502 OnNewSessionFlowControlWindow(new_window); | 498 OnNewSessionFlowControlWindow(new_window); |
| 503 } | 499 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 if (version < QUIC_VERSION_19) { | 771 if (version < QUIC_VERSION_19) { |
| 776 flow_controller_->Disable(); | 772 flow_controller_->Disable(); |
| 777 } | 773 } |
| 778 | 774 |
| 779 // Disable stream level flow control based on negotiated version. Streams may | 775 // Disable stream level flow control based on negotiated version. Streams may |
| 780 // have been created with a different version. | 776 // have been created with a different version. |
| 781 if (version < QUIC_VERSION_21) { | 777 if (version < QUIC_VERSION_21) { |
| 782 GetCryptoStream()->flow_controller()->Disable(); | 778 GetCryptoStream()->flow_controller()->Disable(); |
| 783 headers_stream_->flow_controller()->Disable(); | 779 headers_stream_->flow_controller()->Disable(); |
| 784 } | 780 } |
| 785 for (DataStreamMap::iterator it = stream_map_.begin(); | |
| 786 it != stream_map_.end(); ++it) { | |
| 787 if (version <= QUIC_VERSION_16) { | |
| 788 it->second->flow_controller()->Disable(); | |
| 789 } | |
| 790 } | |
| 791 } | 781 } |
| 792 | 782 |
| 793 } // namespace net | 783 } // namespace net |
| OLD | NEW |