@@ -72,12 +72,12 @@ typedef struct {
72
72
long long min_idle ;
73
73
/* Client flags for filtering. If NULL, no filtering is applied. */
74
74
char * flags ;
75
- /* Client pattern for filtering. If NULL, no filtering is applied. */
76
- robj * pattern ;
77
- /* Client channel for filtering. If NULL, no filtering is applied. */
78
- robj * channel ;
79
- /* Client shard channel for filtering. If NULL, no filtering is applied. */
80
- robj * shard_channel ;
75
+ /* Client subscribed pattern for filtering. If NULL, no filtering is applied. */
76
+ robj * subscribed_pattern ;
77
+ /* Client subscribed channel for filtering. If NULL, no filtering is applied. */
78
+ robj * subscribed_channel ;
79
+ /* Client subscribed shard channel for filtering. If NULL, no filtering is applied. */
80
+ robj * subscribed_shard_channel ;
81
81
} clientFilter ;
82
82
83
83
static void setProtocolError (const char * errstr , client * c );
@@ -3623,14 +3623,14 @@ static int parseClientFiltersOrReply(client *c, int index, clientFilter *filter)
3623
3623
} else if (!strcasecmp (c -> argv [index ]-> ptr , "name" ) && moreargs ) {
3624
3624
filter -> name = c -> argv [index + 1 ]-> ptr ;
3625
3625
index += 2 ;
3626
- } else if (!strcasecmp (c -> argv [index ]-> ptr , "pattern" ) && moreargs ) {
3627
- filter -> pattern = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3626
+ } else if (!strcasecmp (c -> argv [index ]-> ptr , "subscribed- pattern" ) && moreargs ) {
3627
+ filter -> subscribed_pattern = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3628
3628
index += 2 ;
3629
- } else if (!strcasecmp (c -> argv [index ]-> ptr , "channel" ) && moreargs ) {
3630
- filter -> channel = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3629
+ } else if (!strcasecmp (c -> argv [index ]-> ptr , "subscribed- channel" ) && moreargs ) {
3630
+ filter -> subscribed_channel = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3631
3631
index += 2 ;
3632
- } else if (!strcasecmp (c -> argv [index ]-> ptr , "shardchannel " ) && moreargs ) {
3633
- filter -> shard_channel = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3632
+ } else if (!strcasecmp (c -> argv [index ]-> ptr , "subscribed-shard-channel " ) && moreargs ) {
3633
+ filter -> subscribed_shard_channel = createObject (OBJ_STRING , sdsnew (c -> argv [index + 1 ]-> ptr ));
3634
3634
index += 2 ;
3635
3635
} else {
3636
3636
addReplyErrorObject (c , shared .syntaxerr );
@@ -3656,9 +3656,9 @@ static int clientMatchesFilter(client *client, clientFilter client_filter) {
3656
3656
return 0 ;
3657
3657
}
3658
3658
}
3659
- if (client_filter .pattern && !clientSubscribedToPattern (client , client_filter .pattern )) return 0 ;
3660
- if (client_filter .channel && !clientSubscribedToChannel (client , client_filter .channel )) return 0 ;
3661
- if (client_filter .shard_channel && !clientSubscribedToShardChannel (client , client_filter .shard_channel )) return 0 ;
3659
+ if (client_filter .subscribed_pattern && !clientSubscribedToPattern (client , client_filter .subscribed_pattern )) return 0 ;
3660
+ if (client_filter .subscribed_channel && !clientSubscribedToChannel (client , client_filter .subscribed_channel )) return 0 ;
3661
+ if (client_filter .subscribed_shard_channel && !clientSubscribedToShardChannel (client , client_filter .subscribed_shard_channel )) return 0 ;
3662
3662
3663
3663
/* If all conditions are satisfied, the client matches the filter. */
3664
3664
return 1 ;
@@ -3806,12 +3806,12 @@ void clientHelpCommand(client *c) {
3806
3806
" Kill connections that include the specified flags." ,
3807
3807
" * NAME <client-name>" ,
3808
3808
" Kill connections with the specified name." ,
3809
- " * PATTERN <pattern>" ,
3810
- " Kill connections subscribed to a matching pattern." ,
3811
- " * CHANNEL <channel>" ,
3812
- " Kill connections subscribed to a matching channel." ,
3813
- " * SHARD-CHANNEL <shard-channel>" ,
3814
- " Kill connections subscribed to a matching shard channel." ,
3809
+ " * SUBSCRIBED- PATTERN <subscribed- pattern>" ,
3810
+ " Kill connections subscribed to a matching subscribed pattern." ,
3811
+ " * SUBSCRIBED- CHANNEL <subscribed channel>" ,
3812
+ " Kill connections subscribed to a matching subscribed channel." ,
3813
+ " * SUBSCRIBED- SHARD-CHANNEL <subscribed- shard-channel>" ,
3814
+ " Kill connections subscribed to a matching subscribe shard channel." ,
3815
3815
"LIST [options ...]" ,
3816
3816
" Return information about client connections. Options:" ,
3817
3817
" * TYPE (NORMAL|PRIMARY|REPLICA|PUBSUB)" ,
@@ -3834,12 +3834,12 @@ void clientHelpCommand(client *c) {
3834
3834
" Return clients with the specified name." ,
3835
3835
" * MIN-IDLE <min-idle>" ,
3836
3836
" Return clients with idle time greater than or equal to <min-idle> seconds." ,
3837
- " * PATTERN <pattern>" ,
3838
- " Return clients subscribed to a matching pattern." ,
3839
- " * CHANNEL <channel>" ,
3840
- " Return clients subscribed to the specified channel." ,
3841
- " * SHARD-CHANNEL <shard-channel>" ,
3842
- " Return clients subscribed to the specified shard channel." ,
3837
+ " * SUBSCRIBED- PATTERN <subscribed- pattern>" ,
3838
+ " Return clients subscribed to a matching subscribed- pattern." ,
3839
+ " * SUBSCRIBED- CHANNEL <subscribed- channel>" ,
3840
+ " Return clients subscribed to the specified subscribed- channel." ,
3841
+ " * SUBSCRIBED- SHARD-CHANNEL <shard-subscribed -channel>" ,
3842
+ " Return clients subscribed to the specified subscribe shard channel." ,
3843
3843
"UNPAUSE" ,
3844
3844
" Stop the current client pause, resuming traffic." ,
3845
3845
"PAUSE <timeout> [WRITE|ALL]" ,
@@ -4007,17 +4007,17 @@ void clientKillCommand(client *c) {
4007
4007
4008
4008
static void freeClientFilter (clientFilter * filter ) {
4009
4009
zfree (filter -> ids );
4010
- if (filter -> pattern ) {
4011
- decrRefCount (filter -> pattern );
4012
- filter -> pattern = NULL ;
4010
+ if (filter -> subscribed_pattern ) {
4011
+ decrRefCount (filter -> subscribed_pattern );
4012
+ filter -> subscribed_pattern = NULL ;
4013
4013
}
4014
- if (filter -> shard_channel ) {
4015
- decrRefCount (filter -> shard_channel );
4016
- filter -> shard_channel = NULL ;
4014
+ if (filter -> subscribed_shard_channel ) {
4015
+ decrRefCount (filter -> subscribed_shard_channel );
4016
+ filter -> subscribed_shard_channel = NULL ;
4017
4017
}
4018
- if (filter -> channel ) {
4019
- decrRefCount (filter -> channel );
4020
- filter -> channel = NULL ;
4018
+ if (filter -> subscribed_channel ) {
4019
+ decrRefCount (filter -> subscribed_channel );
4020
+ filter -> subscribed_channel = NULL ;
4021
4021
}
4022
4022
}
4023
4023
0 commit comments