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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 return; | 445 return; |
446 } | 446 } |
447 | 447 |
448 DVLOG(1) << ENDPOINT << "Received final byte offset " << final_byte_offset | 448 DVLOG(1) << ENDPOINT << "Received final byte offset " << final_byte_offset |
449 << " for stream " << stream_id; | 449 << " for stream " << stream_id; |
450 uint64 offset_diff = final_byte_offset - it->second; | 450 uint64 offset_diff = final_byte_offset - it->second; |
451 if (flow_controller_->UpdateHighestReceivedOffset( | 451 if (flow_controller_->UpdateHighestReceivedOffset( |
452 flow_controller_->highest_received_byte_offset() + offset_diff)) { | 452 flow_controller_->highest_received_byte_offset() + offset_diff)) { |
453 // If the final offset violates flow control, close the connection now. | 453 // If the final offset violates flow control, close the connection now. |
454 if (flow_controller_->FlowControlViolation()) { | 454 if (flow_controller_->FlowControlViolation()) { |
455 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA); | 455 connection_->SendConnectionClose( |
| 456 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA); |
456 return; | 457 return; |
457 } | 458 } |
458 } | 459 } |
459 | 460 |
460 flow_controller_->AddBytesConsumed(offset_diff); | 461 flow_controller_->AddBytesConsumed(offset_diff); |
461 locally_closed_streams_highest_offset_.erase(it); | 462 locally_closed_streams_highest_offset_.erase(it); |
462 } | 463 } |
463 | 464 |
464 bool QuicSession::IsEncryptionEstablished() { | 465 bool QuicSession::IsEncryptionEstablished() { |
465 return GetCryptoStream()->encryption_established(); | 466 return GetCryptoStream()->encryption_established(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 // with a different version. | 710 // with a different version. |
710 for (DataStreamMap::iterator it = stream_map_.begin(); | 711 for (DataStreamMap::iterator it = stream_map_.begin(); |
711 it != stream_map_.end(); ++it) { | 712 it != stream_map_.end(); ++it) { |
712 if (version < QUIC_VERSION_17) { | 713 if (version < QUIC_VERSION_17) { |
713 it->second->flow_controller()->Disable(); | 714 it->second->flow_controller()->Disable(); |
714 } | 715 } |
715 } | 716 } |
716 } | 717 } |
717 | 718 |
718 } // namespace net | 719 } // namespace net |
OLD | NEW |