From 8d07e06b91836f760dd32c8825dfa4613bf808e0 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 20 Jun 2016 09:10:54 -0700 Subject: [PATCH] Always check for pruning --- server/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/client.go b/server/client.go index 70f8641c..e16b8667 100644 --- a/server/client.go +++ b/server/client.go @@ -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 + } } }