Skip to content

Commit

Permalink
permissions bug in cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Oct 7, 2017
1 parent 12017b2 commit ed5a448
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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}})
}

Expand Down

0 comments on commit ed5a448

Please sign in to comment.