fix: 统一对话密码锁键为发送方加对方不含 IP
This commit is contained in:
@@ -245,6 +245,24 @@ func (l *MemoryLocks) ClearEndpoint(endpointID string) {
|
||||
}
|
||||
}
|
||||
|
||||
// ClearAllForEndpoint 清除该编号作为 EndpointID 或 PeerID 出现的全部锁定。
|
||||
func (l *MemoryLocks) ClearAllForEndpoint(endpointID string) {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
if endpointID == "" {
|
||||
return
|
||||
}
|
||||
for k := range l.entries {
|
||||
parts := splitLockKey(k)
|
||||
if len(parts) != 4 {
|
||||
continue
|
||||
}
|
||||
if parts[1] == endpointID || parts[2] == endpointID {
|
||||
delete(l.entries, k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clear 清除精确键。
|
||||
func (l *MemoryLocks) Clear(key LockKey) {
|
||||
l.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user