handle ACKs separately in the sent packet handler packet struct

This commit is contained in:
Marten Seemann 2019-04-21 20:37:18 +09:00
parent ae685f9d42
commit 5d999f3927
6 changed files with 25 additions and 33 deletions

View file

@ -166,14 +166,12 @@ func (h *sentPacketHandler) sentPacketImpl(packet *Packet) bool /* is ack-elicit
pnSpace.largestSent = packet.PacketNumber
if len(packet.Frames) > 0 {
if ackFrame, ok := packet.Frames[0].(*wire.AckFrame); ok {
packet.largestAcked = ackFrame.LargestAcked()
}
if packet.Ack != nil {
packet.largestAcked = packet.Ack.LargestAcked()
}
packet.Ack = nil // no need to save the ACK
packet.Frames = stripNonAckElicitingFrames(packet.Frames)
isAckEliciting := len(packet.Frames) != 0
isAckEliciting := len(packet.Frames) > 0
if isAckEliciting {
if packet.EncryptionLevel != protocol.Encryption1RTT {