forked from quic-go/quic-go
rename removing of connection IDs to retiring
This commit is contained in:
@@ -51,11 +51,11 @@ func (h *packetHandlerMap) Add(id protocol.ConnectionID, handler packetHandler)
|
||||
h.mutex.Unlock()
|
||||
}
|
||||
|
||||
func (h *packetHandlerMap) Remove(id protocol.ConnectionID) {
|
||||
h.removeByConnectionIDAsString(string(id))
|
||||
func (h *packetHandlerMap) Retire(id protocol.ConnectionID) {
|
||||
h.retireByConnectionIDAsString(string(id))
|
||||
}
|
||||
|
||||
func (h *packetHandlerMap) removeByConnectionIDAsString(id string) {
|
||||
func (h *packetHandlerMap) retireByConnectionIDAsString(id string) {
|
||||
time.AfterFunc(h.deleteClosedSessionsAfter, func() {
|
||||
h.mutex.Lock()
|
||||
delete(h.handlers, id)
|
||||
@@ -79,7 +79,7 @@ func (h *packetHandlerMap) CloseServer() {
|
||||
go func(id string, handler packetHandler) {
|
||||
// session.Close() blocks until the CONNECTION_CLOSE has been sent and the run-loop has stopped
|
||||
_ = handler.Close()
|
||||
h.removeByConnectionIDAsString(id)
|
||||
h.retireByConnectionIDAsString(id)
|
||||
wg.Done()
|
||||
}(id, handler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user