| 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 return true; | 691 return true; |
| 692 } | 692 } |
| 693 | 693 |
| 694 bool QuicConnection::OnStreamFrame(const QuicStreamFrame& frame) { | 694 bool QuicConnection::OnStreamFrame(const QuicStreamFrame& frame) { |
| 695 DCHECK(connected_); | 695 DCHECK(connected_); |
| 696 if (debug_visitor_ != nullptr) { | 696 if (debug_visitor_ != nullptr) { |
| 697 debug_visitor_->OnStreamFrame(frame); | 697 debug_visitor_->OnStreamFrame(frame); |
| 698 } | 698 } |
| 699 if (frame.stream_id != kCryptoStreamId && | 699 if (frame.stream_id != kCryptoStreamId && |
| 700 last_decrypted_packet_level_ == ENCRYPTION_NONE) { | 700 last_decrypted_packet_level_ == ENCRYPTION_NONE) { |
| 701 if (FLAGS_quic_detect_memory_corrpution && | 701 if (MaybeConsiderAsMemoryCorruption(frame)) { |
| 702 MaybeConsiderAsMemoryCorruption(frame)) { | |
| 703 CloseConnection(QUIC_MAYBE_CORRUPTED_MEMORY, | 702 CloseConnection(QUIC_MAYBE_CORRUPTED_MEMORY, |
| 704 "Received crypto frame on non crypto stream.", | 703 "Received crypto frame on non crypto stream.", |
| 705 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 704 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
| 706 return false; | 705 return false; |
| 707 } | 706 } |
| 708 | 707 |
| 709 QUIC_BUG << ENDPOINT | 708 QUIC_BUG << ENDPOINT |
| 710 << "Received an unencrypted data frame: closing connection" | 709 << "Received an unencrypted data frame: closing connection" |
| 711 << " packet_number:" << last_header_.packet_number | 710 << " packet_number:" << last_header_.packet_number |
| 712 << " stream_id:" << frame.stream_id | 711 << " stream_id:" << frame.stream_id |
| (...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 // the sender and a signaling mechanism -- if the sender uses a | 2490 // the sender and a signaling mechanism -- if the sender uses a |
| 2492 // different MinRTO, we may get spurious retransmissions. May not have | 2491 // different MinRTO, we may get spurious retransmissions. May not have |
| 2493 // any benefits, but if the delayed ack becomes a significant source | 2492 // any benefits, but if the delayed ack becomes a significant source |
| 2494 // of (likely, tail) latency, then consider such a mechanism. | 2493 // of (likely, tail) latency, then consider such a mechanism. |
| 2495 const QuicTime::Delta QuicConnection::DelayedAckTime() { | 2494 const QuicTime::Delta QuicConnection::DelayedAckTime() { |
| 2496 return QuicTime::Delta::FromMilliseconds( | 2495 return QuicTime::Delta::FromMilliseconds( |
| 2497 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); | 2496 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); |
| 2498 } | 2497 } |
| 2499 | 2498 |
| 2500 } // namespace net | 2499 } // namespace net |
| OLD | NEW |