ws recycle conn bug fix

pull/354/head
Gordon 2 years ago
parent 0e03c5f89e
commit 9dc798bc53

@ -377,8 +377,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)

Loading…
Cancel
Save