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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 << "Peer sent us an invalid stream flow control send window: " | 521 << "Peer sent us an invalid stream flow control send window: " |
522 << new_window << ", below default: " << kDefaultFlowControlSendWindow; | 522 << new_window << ", below default: " << kDefaultFlowControlSendWindow; |
523 if (connection_->connected()) { | 523 if (connection_->connected()) { |
524 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); | 524 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); |
525 } | 525 } |
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()->UpdateSendWindowOffset(new_window); |
532 headers_stream_->flow_controller()->UpdateSendWindowOffset(new_window); | 532 headers_stream_->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 if (it->second->flow_controller()->UpdateSendWindowOffset(new_window)) { | 536 it->second->UpdateSendWindowOffset(new_window); |
537 it->second->OnCanWrite(); | |
538 } | |
539 } | 537 } |
540 } | 538 } |
541 | 539 |
542 void QuicSession::OnNewSessionFlowControlWindow(uint32 new_window) { | 540 void QuicSession::OnNewSessionFlowControlWindow(uint32 new_window) { |
543 if (new_window < kDefaultFlowControlSendWindow) { | 541 if (new_window < kDefaultFlowControlSendWindow) { |
544 LOG(ERROR) | 542 LOG(ERROR) |
545 << "Peer sent us an invalid session flow control send window: " | 543 << "Peer sent us an invalid session flow control send window: " |
546 << new_window << ", below default: " << kDefaultFlowControlSendWindow; | 544 << new_window << ", below default: " << kDefaultFlowControlSendWindow; |
547 if (connection_->connected()) { | 545 if (connection_->connected()) { |
548 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); | 546 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 776 |
779 // Disable stream level flow control based on negotiated version. Streams may | 777 // Disable stream level flow control based on negotiated version. Streams may |
780 // have been created with a different version. | 778 // have been created with a different version. |
781 if (version < QUIC_VERSION_21) { | 779 if (version < QUIC_VERSION_21) { |
782 GetCryptoStream()->flow_controller()->Disable(); | 780 GetCryptoStream()->flow_controller()->Disable(); |
783 headers_stream_->flow_controller()->Disable(); | 781 headers_stream_->flow_controller()->Disable(); |
784 } | 782 } |
785 } | 783 } |
786 | 784 |
787 } // namespace net | 785 } // namespace net |
OLD | NEW |