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

Function lookupCommandOrOriginal

src/server.cpp:4342–4347  ·  view source on GitHub ↗

Lookup the command in the current table, if not found also check in * the original table containing the original command names unaffected by * keydb.conf rename-command statement. * * This is used by functions rewriting the argument vector such as * rewriteClientCommandVector() in order to set client->cmd pointer * correctly even if the command was renamed. */

Source from the content-addressed store, hash-verified

4340 * rewriteClientCommandVector() in order to set client->cmd pointer
4341 * correctly even if the command was renamed. */
4342struct redisCommand *lookupCommandOrOriginal(sds name) {
4343 struct redisCommand *cmd = (struct redisCommand*)dictFetchValue(g_pserver->commands, name);
4344
4345 if (!cmd) cmd = (struct redisCommand*)dictFetchValue(g_pserver->orig_commands,name);
4346 return cmd;
4347}
4348
4349/* Propagate the specified command (in the context of the specified database id)
4350 * to AOF and Slaves.

Callers 2

Calls 1

dictFetchValueFunction · 0.85

Tested by

no test coverage detected