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

Function retainOriginalCommandVector

src/networking.cpp:3710–3719  ·  view source on GitHub ↗

Keep track of the original command arguments so that we can generate * an accurate slowlog entry after the command has been executed. */

Source from the content-addressed store, hash-verified

3708/* Keep track of the original command arguments so that we can generate
3709 * an accurate slowlog entry after the command has been executed. */
3710static void retainOriginalCommandVector(client *c) {
3711 /* We already rewrote this command, so don't rewrite it again */
3712 if (c->original_argv) return;
3713 c->original_argc = c->argc;
3714 c->original_argv = (robj**)zmalloc(sizeof(robj*)*(c->argc));
3715 for (int j = 0; j < c->argc; j++) {
3716 c->original_argv[j] = c->argv[j];
3717 incrRefCount(c->argv[j]);
3718 }
3719}
3720
3721/* Redact a given argument to prevent it from being shown
3722 * in the slowlog. This information is stored in the

Callers 3

Calls 2

zmallocFunction · 0.85
incrRefCountFunction · 0.85

Tested by

no test coverage detected