Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1b6bdff4
Unverified
Commit
1b6bdff4
authored
Aug 05, 2023
by
zhaozhao.zz
Committed by
GitHub
Aug 05, 2023
Browse files
optimize the check of kill pubsub clients after modifying ACL rules (#12457)
if there are no subscribers, we can ignore the operation
parent
8226f39f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
1b6bdff4
...
...
@@ -1859,6 +1859,12 @@ int ACLCheckAllPerm(client *c, int *idxptr) {
/* Check if the user's existing pub/sub clients violate the ACL pub/sub
* permissions specified via the upcoming argument, and kill them if so. */
void
ACLKillPubsubClientsIfNeeded
(
user
*
new
,
user
*
original
)
{
/* Do nothing if there are no subscribers. */
if
(
!
dictSize
(
server
.
pubsub_patterns
)
&&
!
dictSize
(
server
.
pubsub_channels
)
&&
!
dictSize
(
server
.
pubsubshard_channels
))
return
;
listIter
li
,
lpi
;
listNode
*
ln
,
*
lpn
;
robj
*
o
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment