remove unused packet counter in the receivedPacketTracker

This commit is contained in:
Marten Seemann
2020-06-18 11:28:43 +07:00
parent c956ca4447
commit a8ddba6a39
2 changed files with 0 additions and 5 deletions

View File

@@ -22,7 +22,6 @@ type receivedPacketTracker struct {
hasNewAck bool // true as soon as we received an ack-eliciting new packet
ackQueued bool // true once we received more than 2 (or later in the connection 10) ack-eliciting packets
packetsReceivedSinceLastAck int
ackElicitingPacketsReceivedSinceLastAck int
ackAlarm time.Time
lastAck *wire.AckFrame
@@ -96,8 +95,6 @@ func (h *receivedPacketTracker) hasNewMissingPackets() bool {
// It is implemented analogously to Chrome's QuicConnection::MaybeQueueAck()
// in ACK_DECIMATION_WITH_REORDERING mode.
func (h *receivedPacketTracker) maybeQueueAck(packetNumber protocol.PacketNumber, rcvTime time.Time, shouldInstigateAck, wasMissing bool) {
h.packetsReceivedSinceLastAck++
// always ack the first packet
if h.lastAck == nil {
if !h.ackQueued {
@@ -194,7 +191,6 @@ func (h *receivedPacketTracker) GetAckFrame(onlyIfQueued bool) *wire.AckFrame {
h.ackAlarm = time.Time{}
h.ackQueued = false
h.hasNewAck = false
h.packetsReceivedSinceLastAck = 0
h.ackElicitingPacketsReceivedSinceLastAck = 0
return ack
}

View File

@@ -328,7 +328,6 @@ var _ = Describe("Received Packet Tracker", func() {
tracker.ReceivedPacket(1, time.Time{}, true)
tracker.ackAlarm = time.Now().Add(-time.Minute)
Expect(tracker.GetAckFrame(true)).ToNot(BeNil())
Expect(tracker.packetsReceivedSinceLastAck).To(BeZero())
Expect(tracker.GetAlarmTimeout()).To(BeZero())
Expect(tracker.ackElicitingPacketsReceivedSinceLastAck).To(BeZero())
Expect(tracker.ackQueued).To(BeFalse())