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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 if (incoming_ack.largest_observed > packet_generator_.packet_number()) { | 839 if (incoming_ack.largest_observed > packet_generator_.packet_number()) { |
840 DLOG(WARNING) << ENDPOINT << "Peer's observed unsent packet:" | 840 DLOG(WARNING) << ENDPOINT << "Peer's observed unsent packet:" |
841 << incoming_ack.largest_observed << " vs " | 841 << incoming_ack.largest_observed << " vs " |
842 << packet_generator_.packet_number(); | 842 << packet_generator_.packet_number(); |
843 // We got an error for data we have not sent. Error out. | 843 // We got an error for data we have not sent. Error out. |
844 return "Largest observed too high."; | 844 return "Largest observed too high."; |
845 } | 845 } |
846 | 846 |
847 if (incoming_ack.largest_observed < | 847 if (incoming_ack.largest_observed < |
848 sent_packet_manager_->GetLargestObserved(incoming_ack.path_id)) { | 848 sent_packet_manager_->GetLargestObserved(incoming_ack.path_id)) { |
849 LOG(WARNING) << ENDPOINT << "Peer's largest_observed packet decreased:" | 849 VLOG(1) << ENDPOINT << "Peer's largest_observed packet decreased:" |
850 << incoming_ack.largest_observed << " vs " | 850 << incoming_ack.largest_observed << " vs " |
851 << sent_packet_manager_->GetLargestObserved( | 851 << sent_packet_manager_->GetLargestObserved( |
852 incoming_ack.path_id) | 852 incoming_ack.path_id) |
853 << " packet_number:" << last_header_.packet_number | 853 << " packet_number:" << last_header_.packet_number |
854 << " largest seen with ack:" << largest_seen_packet_with_ack_ | 854 << " largest seen with ack:" << largest_seen_packet_with_ack_ |
855 << " connection_id: " << connection_id_; | 855 << " connection_id: " << connection_id_; |
856 // A new ack has a diminished largest_observed value. Error out. | 856 // A new ack has a diminished largest_observed value. Error out. |
857 // If this was an old packet, we wouldn't even have checked. | 857 // If this was an old packet, we wouldn't even have checked. |
858 return "Largest observed too low."; | 858 return "Largest observed too low."; |
859 } | 859 } |
860 | 860 |
861 if (version() <= QUIC_VERSION_33) { | 861 if (version() <= QUIC_VERSION_33) { |
862 if (!incoming_ack.packets.Empty() && | 862 if (!incoming_ack.packets.Empty() && |
863 incoming_ack.packets.Max() > incoming_ack.largest_observed) { | 863 incoming_ack.packets.Max() > incoming_ack.largest_observed) { |
864 LOG(WARNING) << ENDPOINT | 864 LOG(WARNING) << ENDPOINT |
865 << "Peer sent missing packet: " << incoming_ack.packets.Max() | 865 << "Peer sent missing packet: " << incoming_ack.packets.Max() |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 // the sender and a signaling mechanism -- if the sender uses a | 2494 // the sender and a signaling mechanism -- if the sender uses a |
2495 // different MinRTO, we may get spurious retransmissions. May not have | 2495 // different MinRTO, we may get spurious retransmissions. May not have |
2496 // any benefits, but if the delayed ack becomes a significant source | 2496 // any benefits, but if the delayed ack becomes a significant source |
2497 // of (likely, tail) latency, then consider such a mechanism. | 2497 // of (likely, tail) latency, then consider such a mechanism. |
2498 const QuicTime::Delta QuicConnection::DelayedAckTime() { | 2498 const QuicTime::Delta QuicConnection::DelayedAckTime() { |
2499 return QuicTime::Delta::FromMilliseconds( | 2499 return QuicTime::Delta::FromMilliseconds( |
2500 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); | 2500 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); |
2501 } | 2501 } |
2502 | 2502 |
2503 } // namespace net | 2503 } // namespace net |
OLD | NEW |