From ed5a4485079065b1eab4357d565e29b13c4c08a3 Mon Sep 17 00:00:00 2001 From: or-else Date: Fri, 6 Oct 2017 18:45:45 -0700 Subject: [PATCH] permissions bug in cluster mode --- server/cluster.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/cluster.go b/server/cluster.go index 34c5e470a..2a6b0798d 100644 --- a/server/cluster.go +++ b/server/cluster.go @@ -70,6 +70,12 @@ type ClusterSess struct { // Protocol version of the client: ((major & 0xff) << 8) | (minor & 0xff) Ver int + // Human language of the client + Lang string + + // Device ID + DeviceId string + // Session ID Sid string } @@ -291,6 +297,8 @@ func (c *Cluster) Master(msg *ClusterReq, rejected *bool) error { sess.ver = msg.Sess.Ver sess.userAgent = msg.Sess.UserAgent sess.remoteAddr = msg.Sess.RemoteAddr + sess.lang = msg.Sess.Lang + sess.deviceId = msg.Sess.DeviceId // Dispatch remote message to a local session. sess.dispatch(msg.Msg) @@ -368,9 +376,12 @@ func (c *Cluster) routeToTopic(msg *ClientComMessage, topic string, sess *Sessio RcptTo: topic, Sess: &ClusterSess{ Uid: sess.uid, + AuthLvl: sess.authLvl, RemoteAddr: sess.remoteAddr, UserAgent: sess.userAgent, Ver: sess.ver, + Lang: sess.lang, + DeviceId: sess.deviceId, Sid: sess.sid}}) }