Fix RemoveConnByUfrag

This commit is contained in:
braginini 2022-09-08 19:39:05 +02:00
parent 5a504ee6be
commit f07671cf49

View File

@ -176,7 +176,15 @@ func (m *UDPMuxDefault) RemoveConnByUfrag(ufrag string) {
for _, c := range removedConns {
addresses := c.getAddresses()
for _, addr := range addresses {
delete(m.addressMap, addr)
if connList, ok := m.addressMap[addr]; ok {
var newList []*udpMuxedConn
for _, conn := range connList {
if conn.params.Key != ufrag {
newList = append(newList, conn)
}
}
m.addressMap[addr] = newList
}
}
}
}