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 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 // send, send an ack to raise the high water mark. | 926 // send, send an ack to raise the high water mark. |
927 if (!last_ack_frames_.back().missing_packets.empty() && | 927 if (!last_ack_frames_.back().missing_packets.empty() && |
928 GetLeastUnacked() > *last_ack_frames_.back().missing_packets.begin()) { | 928 GetLeastUnacked() > *last_ack_frames_.back().missing_packets.begin()) { |
929 ++stop_waiting_count_; | 929 ++stop_waiting_count_; |
930 } else { | 930 } else { |
931 stop_waiting_count_ = 0; | 931 stop_waiting_count_ = 0; |
932 } | 932 } |
933 } | 933 } |
934 | 934 |
935 QuicPacketSequenceNumber QuicConnection::GetLeastUnacked() const { | 935 QuicPacketSequenceNumber QuicConnection::GetLeastUnacked() const { |
936 return sent_packet_manager_.HasUnackedPackets() ? | 936 return sent_packet_manager_.GetLeastUnacked(); |
937 sent_packet_manager_.GetLeastUnackedSentPacket() : | |
938 packet_generator_.sequence_number() + 1; | |
939 } | 937 } |
940 | 938 |
941 void QuicConnection::MaybeSendInResponseToPacket() { | 939 void QuicConnection::MaybeSendInResponseToPacket() { |
942 if (!connected_) { | 940 if (!connected_) { |
943 return; | 941 return; |
944 } | 942 } |
945 ScopedPacketBundler bundler(this, ack_queued_ ? SEND_ACK : NO_ACK); | 943 ScopedPacketBundler bundler(this, ack_queued_ ? SEND_ACK : NO_ACK); |
946 | 944 |
947 // Now that we have received an ack, we might be able to send packets which | 945 // Now that we have received an ack, we might be able to send packets which |
948 // are queued locally, or drain streams which are blocked. | 946 // are queued locally, or drain streams which are blocked. |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 } | 1993 } |
1996 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 1994 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
1997 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 1995 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
1998 return true; | 1996 return true; |
1999 } | 1997 } |
2000 } | 1998 } |
2001 return false; | 1999 return false; |
2002 } | 2000 } |
2003 | 2001 |
2004 } // namespace net | 2002 } // namespace net |
OLD | NEW |