Always check for pruning

This commit is contained in:
Derek Collison
2016-06-20 09:10:54 -07:00
parent fa95bd936b
commit 8d07e06b91

View File

@@ -895,10 +895,10 @@ func (c *client) processMsg(msg []byte) {
}
if !ok {
r := c.perms.pub.Match(string(c.pa.subject))
if len(r.psubs) == 0 {
notAllowed := len(r.psubs) == 0
if notAllowed {
c.pubPermissionViolation(c.pa.subject)
c.perms.pcache[string(c.pa.subject)] = false
return
} else {
c.perms.pcache[string(c.pa.subject)] = true
}
@@ -914,6 +914,10 @@ func (c *client) processMsg(msg []byte) {
}
}
}
// Return here to allow the pruning code to run if needed.
if notAllowed {
return
}
}
}