proxyCtrlBroadcast broadcasts a ctrl command to certain sessions attached to this proxy topic.
(msg *ServerComMessage)
| 267 | |
| 268 | // proxyCtrlBroadcast broadcasts a ctrl command to certain sessions attached to this proxy topic. |
| 269 | func (t *Topic) proxyCtrlBroadcast(msg *ServerComMessage) { |
| 270 | if msg.Ctrl.Code == http.StatusResetContent && msg.Ctrl.Text == "evicted" { |
| 271 | // We received a ctrl command for evicting a user. |
| 272 | if msg.uid.IsZero() { |
| 273 | logs.Err.Panicf("proxy topic[%s]: proxy received evict message with empty uid", t.name) |
| 274 | } |
| 275 | for sess := range t.sessions { |
| 276 | // Proxy topic may only have ordinary sessions. No multiplexing or proxy sessions here. |
| 277 | if _, removed := t.remSession(sess, msg.uid); removed { |
| 278 | sess.detachSession(t.name) |
| 279 | if sess.sid != msg.SkipSid { |
| 280 | sess.queueOut(msg) |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | // updateAcsFromPresMsg modifies user acs in Topic's perUser struct based on the data in `pres`. |
| 288 | func (t *Topic) updateAcsFromPresMsg(pres *MsgServerPres) { |
no test coverage detected