user conn map copy

pull/455/head
Gordon 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent bdb8642c12
commit a5f79eae07

@ -259,7 +259,11 @@ func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn {
rwLock.RLock()
defer rwLock.RUnlock()
if connMap, ok := ws.wsUserToConn[uid]; ok {
return connMap
newConnMap := make(map[int]*UserConn)
for k, v := range connMap {
newConnMap[k] = v
}
return newConnMap
}
return nil
}

Loading…
Cancel
Save