In handleLeaveReq, remove session subscriptions directly.

Instead of writing to Session.detach.
This commit is contained in:
aforge
2023-07-07 09:03:58 -07:00
parent 2f632ecc91
commit e776c4d466
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -720,7 +720,7 @@ func (t *Topic) handleLeaveRequest(msg *ClientComMessage, sess *Session) {
// User wants to leave without unsubscribing.
if pssd, _ := t.remSession(sess, asUid); pssd != nil {
if !sess.isProxy() {
sess.detach <- t.name
sess.delSub(t.name)
}
if pssd.isChanSub != asChan {
// Cannot address non-channel subscription as channel and vice versa.
+1 -1
View File
@@ -139,7 +139,7 @@ func (t *Topic) handleProxyLeaveRequest(msg *ClientComMessage, killTimer *time.T
// and we won't be able to find and remove it by its sid.
pssd, result := t.remSession(msg.sess, asUid)
if result {
msg.sess.detach <- t.name
msg.sess.delSub(t.name)
}
if !msg.init {
// Explicitly specify the uid because the master multiplex session needs to know which