forked from quic-go/quic-go
delete 0-RTT queues if no Initial is received within 100ms
This commit is contained in:
@@ -2,6 +2,7 @@ package quic
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
|
||||
@@ -85,4 +86,12 @@ var _ = Describe("0-RTT queue", func() {
|
||||
// The queue should now be empty.
|
||||
Expect(q.Dequeue(connID)).To(BeNil())
|
||||
})
|
||||
|
||||
It("deletes packets if they aren't dequeued after a short while", func() {
|
||||
connID := protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef}
|
||||
p := &receivedPacket{data: []byte("foobar")}
|
||||
q.Enqueue(connID, p)
|
||||
time.Sleep(protocol.Max0RTTQueueingDuration * 3 / 2)
|
||||
Expect(q.Dequeue(connID)).To(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user