mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
fb37bea439
@ -270,7 +270,7 @@ userInfoUpdated:
|
|||||||
|
|
||||||
#####################conversation#########################
|
#####################conversation#########################
|
||||||
conversationChanged:
|
conversationChanged:
|
||||||
isSendMsg: true
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
|
@ -56,6 +56,9 @@ func newContext(respWriter http.ResponseWriter, req *http.Request) *UserConnCont
|
|||||||
ConnID: utils.Md5(req.RemoteAddr + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))),
|
ConnID: utils.Md5(req.RemoteAddr + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (c *UserConnContext) GetRemoteAddr() string {
|
||||||
|
return c.RemoteAddr
|
||||||
|
}
|
||||||
func (c *UserConnContext) Query(key string) (string, bool) {
|
func (c *UserConnContext) Query(key string) (string, bool) {
|
||||||
var value string
|
var value string
|
||||||
if value = c.Req.URL.Query().Get(key); value == "" {
|
if value = c.Req.URL.Query().Get(key); value == "" {
|
||||||
|
@ -132,7 +132,7 @@ func (ws *WsServer) registerClient(client *Client) {
|
|||||||
if clientOK { //已经有同平台的连接存在
|
if clientOK { //已经有同平台的连接存在
|
||||||
ws.clients.Set(client.userID, client)
|
ws.clients.Set(client.userID, client)
|
||||||
ws.multiTerminalLoginChecker(cli)
|
ws.multiTerminalLoginChecker(cli)
|
||||||
log.ZInfo(client.ctx, "repeat login", "userID", client.userID, "platformID", client.platformID)
|
log.ZInfo(client.ctx, "repeat login", "userID", client.userID, "platformID", client.platformID, "old remote addr", getRemoteAdders(cli))
|
||||||
atomic.AddInt64(&ws.onlineUserConnNum, 1)
|
atomic.AddInt64(&ws.onlineUserConnNum, 1)
|
||||||
} else {
|
} else {
|
||||||
ws.clients.Set(client.userID, client)
|
ws.clients.Set(client.userID, client)
|
||||||
@ -141,6 +141,17 @@ func (ws *WsServer) registerClient(client *Client) {
|
|||||||
}
|
}
|
||||||
log.ZInfo(client.ctx, "user online", "online user Num", ws.onlineUserNum, "online user conn Num", ws.onlineUserConnNum)
|
log.ZInfo(client.ctx, "user online", "online user Num", ws.onlineUserNum, "online user conn Num", ws.onlineUserConnNum)
|
||||||
}
|
}
|
||||||
|
func getRemoteAdders(client []*Client) string {
|
||||||
|
var ret string
|
||||||
|
for i, c := range client {
|
||||||
|
if i == 0 {
|
||||||
|
ret = c.ctx.GetRemoteAddr()
|
||||||
|
} else {
|
||||||
|
ret += "@" + c.ctx.GetRemoteAddr()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
func (ws *WsServer) multiTerminalLoginChecker(client []*Client) {
|
func (ws *WsServer) multiTerminalLoginChecker(client []*Client) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user