mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
implement replacing with a closed session for all active connection IDs
This commit is contained in:
parent
f948165824
commit
5d0d0d0679
2 changed files with 35 additions and 9 deletions
|
@ -18,6 +18,7 @@ type connIDGenerator struct {
|
|||
addConnectionID func(protocol.ConnectionID) [16]byte
|
||||
removeConnectionID func(protocol.ConnectionID)
|
||||
retireConnectionID func(protocol.ConnectionID)
|
||||
replaceWithClosed func(protocol.ConnectionID, packetHandler)
|
||||
queueControlFrame func(wire.Frame)
|
||||
}
|
||||
|
||||
|
@ -26,6 +27,7 @@ func newConnIDGenerator(
|
|||
addConnectionID func(protocol.ConnectionID) [16]byte,
|
||||
removeConnectionID func(protocol.ConnectionID),
|
||||
retireConnectionID func(protocol.ConnectionID),
|
||||
replaceWithClosed func(protocol.ConnectionID, packetHandler),
|
||||
queueControlFrame func(wire.Frame),
|
||||
) *connIDGenerator {
|
||||
m := &connIDGenerator{
|
||||
|
@ -34,6 +36,7 @@ func newConnIDGenerator(
|
|||
addConnectionID: addConnectionID,
|
||||
removeConnectionID: removeConnectionID,
|
||||
retireConnectionID: retireConnectionID,
|
||||
replaceWithClosed: replaceWithClosed,
|
||||
queueControlFrame: queueControlFrame,
|
||||
}
|
||||
m.activeSrcConnIDs[0] = initialConnectionID
|
||||
|
@ -93,3 +96,9 @@ func (m *connIDGenerator) RemoveAll() {
|
|||
m.removeConnectionID(connID)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *connIDGenerator) ReplaceWithClosed(handler packetHandler) {
|
||||
for _, connID := range m.activeSrcConnIDs {
|
||||
m.replaceWithClosed(connID, handler)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue