MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / moduleCallCommandFilters

Function moduleCallCommandFilters

src/module.cpp:7651–7674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7649}
7650
7651void moduleCallCommandFilters(client *c) {
7652 if (listLength(moduleCommandFilters) == 0) return;
7653
7654 listIter li;
7655 listNode *ln;
7656 listRewind(moduleCommandFilters,&li);
7657
7658 RedisModuleCommandFilterCtx filter = { c->argv, c->argc };
7659
7660 while((ln = listNext(&li))) {
7661 RedisModuleCommandFilter *f = (RedisModuleCommandFilter*)ln->value;
7662
7663 /* Skip filter if REDISMODULE_CMDFILTER_NOSELF is set and module is
7664 * currently processing a command.
7665 */
7666 if ((f->flags & REDISMODULE_CMDFILTER_NOSELF) && f->module->in_call) continue;
7667
7668 /* Call filter */
7669 f->callback(&filter);
7670 }
7671
7672 c->argv = filter.argv;
7673 c->argc = filter.argc;
7674}
7675
7676/* Return the number of arguments a filtered command has. The number of
7677 * arguments include the command itself.

Callers 3

processCommandFunction · 0.85
RM_CallFunction · 0.85
luaRedisGenericCommandFunction · 0.85

Calls 2

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected