mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
rename lastSentAckElicitingPacketTime to lastAckElicitingPacketTime
This commit is contained in:
parent
c8e5bb5b50
commit
feb3e9a713
2 changed files with 12 additions and 12 deletions
|
@ -28,8 +28,8 @@ type packetNumberSpace struct {
|
|||
history *sentPacketHistory
|
||||
pns *packetNumberGenerator
|
||||
|
||||
lossTime time.Time
|
||||
lastSentAckElicitingPacketTime time.Time
|
||||
lossTime time.Time
|
||||
lastAckElicitingPacketTime time.Time
|
||||
|
||||
largestAcked protocol.PacketNumber
|
||||
largestSent protocol.PacketNumber
|
||||
|
@ -244,7 +244,7 @@ func (h *sentPacketHandler) sentPacketImpl(packet *Packet) bool /* is ack-elicit
|
|||
isAckEliciting := len(packet.Frames) > 0
|
||||
|
||||
if isAckEliciting {
|
||||
pnSpace.lastSentAckElicitingPacketTime = packet.SendTime
|
||||
pnSpace.lastAckElicitingPacketTime = packet.SendTime
|
||||
packet.includedInBytesInFlight = true
|
||||
h.bytesInFlight += packet.Length
|
||||
if h.numProbesToSend > 0 {
|
||||
|
@ -419,22 +419,22 @@ func (h *sentPacketHandler) getEarliestLossTimeAndSpace() (time.Time, protocol.E
|
|||
return lossTime, encLevel
|
||||
}
|
||||
|
||||
// same logic as getEarliestLossTimeAndSpace, but for lastSentAckElicitingPacketTime instead of lossTime
|
||||
// same logic as getEarliestLossTimeAndSpace, but for lastAckElicitingPacketTime instead of lossTime
|
||||
func (h *sentPacketHandler) getEarliestSentTimeAndSpace() (time.Time, protocol.EncryptionLevel) {
|
||||
var encLevel protocol.EncryptionLevel
|
||||
var sentTime time.Time
|
||||
|
||||
if h.initialPackets != nil {
|
||||
sentTime = h.initialPackets.lastSentAckElicitingPacketTime
|
||||
sentTime = h.initialPackets.lastAckElicitingPacketTime
|
||||
encLevel = protocol.EncryptionInitial
|
||||
}
|
||||
if h.handshakePackets != nil && (sentTime.IsZero() || (!h.handshakePackets.lastSentAckElicitingPacketTime.IsZero() && h.handshakePackets.lastSentAckElicitingPacketTime.Before(sentTime))) {
|
||||
sentTime = h.handshakePackets.lastSentAckElicitingPacketTime
|
||||
if h.handshakePackets != nil && (sentTime.IsZero() || (!h.handshakePackets.lastAckElicitingPacketTime.IsZero() && h.handshakePackets.lastAckElicitingPacketTime.Before(sentTime))) {
|
||||
sentTime = h.handshakePackets.lastAckElicitingPacketTime
|
||||
encLevel = protocol.EncryptionHandshake
|
||||
}
|
||||
if h.handshakeComplete &&
|
||||
(sentTime.IsZero() || (!h.appDataPackets.lastSentAckElicitingPacketTime.IsZero() && h.appDataPackets.lastSentAckElicitingPacketTime.Before(sentTime))) {
|
||||
sentTime = h.appDataPackets.lastSentAckElicitingPacketTime
|
||||
(sentTime.IsZero() || (!h.appDataPackets.lastAckElicitingPacketTime.IsZero() && h.appDataPackets.lastAckElicitingPacketTime.Before(sentTime))) {
|
||||
sentTime = h.appDataPackets.lastAckElicitingPacketTime
|
||||
encLevel = protocol.Encryption1RTT
|
||||
}
|
||||
return sentTime, encLevel
|
||||
|
|
|
@ -125,20 +125,20 @@ var _ = Describe("SentPacketHandler", func() {
|
|||
It("stores the sent time", func() {
|
||||
sendTime := time.Now().Add(-time.Minute)
|
||||
handler.SentPacket(ackElicitingPacket(&Packet{PacketNumber: 1, SendTime: sendTime}))
|
||||
Expect(handler.appDataPackets.lastSentAckElicitingPacketTime).To(Equal(sendTime))
|
||||
Expect(handler.appDataPackets.lastAckElicitingPacketTime).To(Equal(sendTime))
|
||||
})
|
||||
|
||||
It("stores the sent time of Initial packets", func() {
|
||||
sendTime := time.Now().Add(-time.Minute)
|
||||
handler.SentPacket(ackElicitingPacket(&Packet{PacketNumber: 1, SendTime: sendTime, EncryptionLevel: protocol.EncryptionInitial}))
|
||||
handler.SentPacket(ackElicitingPacket(&Packet{PacketNumber: 2, SendTime: sendTime.Add(time.Hour), EncryptionLevel: protocol.Encryption1RTT}))
|
||||
Expect(handler.initialPackets.lastSentAckElicitingPacketTime).To(Equal(sendTime))
|
||||
Expect(handler.initialPackets.lastAckElicitingPacketTime).To(Equal(sendTime))
|
||||
})
|
||||
|
||||
It("does not store non-ack-eliciting packets", func() {
|
||||
handler.SentPacket(nonAckElicitingPacket(&Packet{PacketNumber: 1}))
|
||||
Expect(handler.appDataPackets.history.Len()).To(BeZero())
|
||||
Expect(handler.appDataPackets.lastSentAckElicitingPacketTime).To(BeZero())
|
||||
Expect(handler.appDataPackets.lastAckElicitingPacketTime).To(BeZero())
|
||||
Expect(handler.bytesInFlight).To(BeZero())
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue