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

Function rewriteClientCommandVector

src/networking.cpp:3733–3749  ·  view source on GitHub ↗

Rewrite the command vector of the client. All the new objects ref count * is incremented. The old command vector is freed, and the old objects * ref count is decremented. */

Source from the content-addressed store, hash-verified

3731 * is incremented. The old command vector is freed, and the old objects
3732 * ref count is decremented. */
3733void rewriteClientCommandVector(client *c, int argc, ...) {
3734 va_list ap;
3735 int j;
3736 robj **argv; /* The new argument vector */
3737
3738 argv = (robj**)zmalloc(sizeof(robj*)*argc, MALLOC_LOCAL);
3739 va_start(ap,argc);
3740 for (j = 0; j < argc; j++) {
3741 robj *a;
3742
3743 a = va_arg(ap, robj*);
3744 argv[j] = a;
3745 incrRefCount(a);
3746 }
3747 replaceClientCommandVector(c, argc, argv);
3748 va_end(ap);
3749}
3750
3751/* Completely replace the client command vector with the provided one. */
3752void replaceClientCommandVector(client *c, int argc, robj **argv) {

Callers 11

restoreCommandFunction · 0.85
expireGenericCommandFunction · 0.85
spopWithCountCommandFunction · 0.85
spopCommandFunction · 0.85
setGenericCommandFunction · 0.85
getexCommandFunction · 0.85
getdelCommandFunction · 0.85
evalGenericCommandFunction · 0.85
lmoveGenericCommandFunction · 0.85

Calls 3

zmallocFunction · 0.85
incrRefCountFunction · 0.85

Tested by

no test coverage detected