From 8df4a09922acccafd1b66daea55eaad22140c533 Mon Sep 17 00:00:00 2001 From: zeekling Date: Wed, 10 May 2023 22:49:47 +0800 Subject: [PATCH] format code --- src/redis-acl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/redis-acl.c b/src/redis-acl.c index a240117..1697629 100644 --- a/src/redis-acl.c +++ b/src/redis-acl.c @@ -1,4 +1,3 @@ - #include #include "redis-acl.h" #include "redismodule.h" @@ -6,8 +5,8 @@ static RedisModuleCommandFilter *filter; void AuthFilter_CommandFilter(RedisModuleCommandFilter *filter) { - int log = 0; - int pos = 0; + int log = 0; + int pos = 0; RedisModule_Log(NULL, LOG_LEVL_NOTICE, "command filter"); while (pos < RedisModule_CommandFilterArgsCount(filter)) { const RedisModuleString *arg = RedisModule_CommandFilterArgGet(filter, pos); @@ -33,15 +32,15 @@ int AuthCommand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int void create_users(RedisModuleCtx *ctx) { RedisModuleUser *user = RedisModule_CreateModuleUser("default"); RedisModule_SetModuleUserACL(user, "allcommands"); - RedisModule_SetModuleUserACL(user, "allkeys"); - RedisModule_SetModuleUserACL(user, "on"); + RedisModule_SetModuleUserACL(user, "allkeys"); + RedisModule_SetModuleUserACL(user, "on"); RedisModule_Log(ctx, LOG_LEVL_NOTICE, "init module user success!"); RedisModule_FreeModuleUser(user); } int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { REDISMODULE_NOT_USED(argv); - REDISMODULE_NOT_USED(argc); + REDISMODULE_NOT_USED(argc); if (RedisModule_Init(ctx, "redis-auth", 1, REDISMODULE_APIVER_1) == REDISMODULE_ERR) { RedisModule_Log(ctx, LOG_LEVL_NOTICE, "init redis-auth failed"); return REDISMODULE_ERR; @@ -49,8 +48,7 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) create_users(ctx); - - filter = RedisModule_RegisterCommandFilter(ctx, AuthFilter_CommandFilter, 0); + filter = RedisModule_RegisterCommandFilter(ctx, AuthFilter_CommandFilter, 0); if (filter == NULL) { return REDISMODULE_ERR; }