Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: net/quic/quic_connection.cc

Issue 530343002: Change GetLeastUnacked() to return the next packet that could be sent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@IsRetransmittable_74359363
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698