mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
add a flag to disable conn ID generation and the check for retired conn IDs
This commit is contained in:
parent
953f3472cf
commit
ce5ddc050c
3 changed files with 35 additions and 1 deletions
|
@ -62,6 +62,15 @@ var _ = Describe("Connection ID Generator", func() {
|
|||
}
|
||||
})
|
||||
|
||||
It("doesn't issue new connection IDs in RetireBugBackwardsCompatibilityMode", func() {
|
||||
RetireBugBackwardsCompatibilityMode = true
|
||||
defer func() { RetireBugBackwardsCompatibilityMode = false }()
|
||||
|
||||
Expect(g.SetMaxActiveConnIDs(4)).To(Succeed())
|
||||
Expect(retiredConnIDs).To(BeEmpty())
|
||||
Expect(addedConnIDs).To(BeEmpty())
|
||||
})
|
||||
|
||||
It("limits the number of connection IDs that it issues", func() {
|
||||
Expect(g.SetMaxActiveConnIDs(9999999)).To(Succeed())
|
||||
Expect(retiredConnIDs).To(BeEmpty())
|
||||
|
@ -81,6 +90,18 @@ var _ = Describe("Connection ID Generator", func() {
|
|||
Expect(g.Retire(f.SequenceNumber, f.ConnectionID)).To(MatchError(fmt.Sprintf("PROTOCOL_VIOLATION: tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", f.SequenceNumber, f.ConnectionID)))
|
||||
})
|
||||
|
||||
It("doesn't error if the peers tries to retire a connection ID in a packet with that connection ID in RetireBugBackwardsCompatibilityMode", func() {
|
||||
Expect(g.SetMaxActiveConnIDs(4)).To(Succeed())
|
||||
Expect(queuedFrames).ToNot(BeEmpty())
|
||||
Expect(queuedFrames[0]).To(BeAssignableToTypeOf(&wire.NewConnectionIDFrame{}))
|
||||
|
||||
RetireBugBackwardsCompatibilityMode = true
|
||||
defer func() { RetireBugBackwardsCompatibilityMode = false }()
|
||||
|
||||
f := queuedFrames[0].(*wire.NewConnectionIDFrame)
|
||||
Expect(g.Retire(f.SequenceNumber, f.ConnectionID)).To(Succeed())
|
||||
})
|
||||
|
||||
It("issues new connection IDs, when old ones are retired", func() {
|
||||
Expect(g.SetMaxActiveConnIDs(5)).To(Succeed())
|
||||
queuedFrames = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue