mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 19:16:35 +08:00
ws recycle conn bug fix
This commit is contained in:
committed by
Xinwei Xiong(cubxxw-openim)
parent
09fe19d97b
commit
4a7026622e
@@ -220,8 +220,12 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
||||
platform = k
|
||||
uid = v
|
||||
}
|
||||
if oldConnMap, ok := ws.wsUserToConn[uid]; ok {
|
||||
delete(oldConnMap, platform)
|
||||
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // only recycle self conn
|
||||
if oldconn, okMap := oldConnMap[platform]; okMap {
|
||||
if oldconn == conn {
|
||||
delete(oldConnMap, platform)
|
||||
}
|
||||
}
|
||||
ws.wsUserToConn[uid] = oldConnMap
|
||||
if len(oldConnMap) == 0 {
|
||||
delete(ws.wsUserToConn, uid)
|
||||
|
||||
Reference in New Issue
Block a user