| 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 return; | 526 return; |
| 527 } | 527 } |
| 528 | 528 |
| 529 // Inform all existing streams about the new window. | 529 // Inform all existing streams about the new window. |
| 530 if (connection_->version() >= QUIC_VERSION_21) { | 530 if (connection_->version() >= QUIC_VERSION_21) { |
| 531 GetCryptoStream()->flow_controller()->UpdateSendWindowOffset(new_window); | 531 GetCryptoStream()->flow_controller()->UpdateSendWindowOffset(new_window); |
| 532 headers_stream_->flow_controller()->UpdateSendWindowOffset(new_window); | 532 headers_stream_->flow_controller()->UpdateSendWindowOffset(new_window); |
| 533 } | 533 } |
| 534 for (DataStreamMap::iterator it = stream_map_.begin(); | 534 for (DataStreamMap::iterator it = stream_map_.begin(); |
| 535 it != stream_map_.end(); ++it) { | 535 it != stream_map_.end(); ++it) { |
| 536 it->second->flow_controller()->UpdateSendWindowOffset(new_window); | 536 if (it->second->flow_controller()->UpdateSendWindowOffset(new_window)) { |
| 537 it->second->OnCanWrite(); |
| 538 } |
| 537 } | 539 } |
| 538 } | 540 } |
| 539 | 541 |
| 540 void QuicSession::OnNewSessionFlowControlWindow(uint32 new_window) { | 542 void QuicSession::OnNewSessionFlowControlWindow(uint32 new_window) { |
| 541 if (new_window < kDefaultFlowControlSendWindow) { | 543 if (new_window < kDefaultFlowControlSendWindow) { |
| 542 LOG(ERROR) | 544 LOG(ERROR) |
| 543 << "Peer sent us an invalid session flow control send window: " | 545 << "Peer sent us an invalid session flow control send window: " |
| 544 << new_window << ", below default: " << kDefaultFlowControlSendWindow; | 546 << new_window << ", below default: " << kDefaultFlowControlSendWindow; |
| 545 if (connection_->connected()) { | 547 if (connection_->connected()) { |
| 546 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); | 548 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 778 |
| 777 // Disable stream level flow control based on negotiated version. Streams may | 779 // Disable stream level flow control based on negotiated version. Streams may |
| 778 // have been created with a different version. | 780 // have been created with a different version. |
| 779 if (version < QUIC_VERSION_21) { | 781 if (version < QUIC_VERSION_21) { |
| 780 GetCryptoStream()->flow_controller()->Disable(); | 782 GetCryptoStream()->flow_controller()->Disable(); |
| 781 headers_stream_->flow_controller()->Disable(); | 783 headers_stream_->flow_controller()->Disable(); |
| 782 } | 784 } |
| 783 } | 785 } |
| 784 | 786 |
| 785 } // namespace net | 787 } // namespace net |
| OLD | NEW |