mirror of https://github.com/tidwall/redcon.git
Merge pull request #48 from shankai/master
Fix: unsubscribe single channel from (p)subscribe.
This commit is contained in:
commit
12fd027cec
|
@ -1358,14 +1358,12 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// unsubscribe single channel from (p)subscribe.
|
// unsubscribe single channel from (p)subscribe.
|
||||||
var entry *pubSubEntry
|
|
||||||
for ient := range sconn.entries {
|
for ient := range sconn.entries {
|
||||||
if ient.pattern == pattern && ient.channel == channel {
|
if ient.pattern == pattern && ient.channel == channel {
|
||||||
removeEntry(entry)
|
removeEntry(ient)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
removeEntry(entry)
|
|
||||||
}
|
}
|
||||||
sconn.dconn.Flush()
|
sconn.dconn.Flush()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue