mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
implement removing of all active connection IDs
This commit is contained in:
parent
121795977d
commit
f948165824
2 changed files with 25 additions and 0 deletions
|
@ -16,6 +16,7 @@ type connIDGenerator struct {
|
|||
activeSrcConnIDs map[uint64]protocol.ConnectionID
|
||||
|
||||
addConnectionID func(protocol.ConnectionID) [16]byte
|
||||
removeConnectionID func(protocol.ConnectionID)
|
||||
retireConnectionID func(protocol.ConnectionID)
|
||||
queueControlFrame func(wire.Frame)
|
||||
}
|
||||
|
@ -23,6 +24,7 @@ type connIDGenerator struct {
|
|||
func newConnIDGenerator(
|
||||
initialConnectionID protocol.ConnectionID,
|
||||
addConnectionID func(protocol.ConnectionID) [16]byte,
|
||||
removeConnectionID func(protocol.ConnectionID),
|
||||
retireConnectionID func(protocol.ConnectionID),
|
||||
queueControlFrame func(wire.Frame),
|
||||
) *connIDGenerator {
|
||||
|
@ -30,6 +32,7 @@ func newConnIDGenerator(
|
|||
connIDLen: initialConnectionID.Len(),
|
||||
activeSrcConnIDs: make(map[uint64]protocol.ConnectionID),
|
||||
addConnectionID: addConnectionID,
|
||||
removeConnectionID: removeConnectionID,
|
||||
retireConnectionID: retireConnectionID,
|
||||
queueControlFrame: queueControlFrame,
|
||||
}
|
||||
|
@ -84,3 +87,9 @@ func (m *connIDGenerator) issueNewConnID() error {
|
|||
m.highestSeq++
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *connIDGenerator) RemoveAll() {
|
||||
for _, connID := range m.activeSrcConnIDs {
|
||||
m.removeConnectionID(connID)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue