MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rewriteClientCommandVector

Function rewriteClientCommandVector

app/redis-6.2.6/src/networking.c:3096–3112  ·  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

3094 * is incremented. The old command vector is freed, and the old objects
3095 * ref count is decremented. */
3096void rewriteClientCommandVector(client *c, int argc, ...) {
3097 va_list ap;
3098 int j;
3099 robj **argv; /* The new argument vector */
3100
3101 argv = zmalloc(sizeof(robj*)*argc);
3102 va_start(ap,argc);
3103 for (j = 0; j < argc; j++) {
3104 robj *a;
3105
3106 a = va_arg(ap, robj*);
3107 argv[j] = a;
3108 incrRefCount(a);
3109 }
3110 replaceClientCommandVector(c, argc, argv);
3111 va_end(ap);
3112}
3113
3114/* Completely replace the client command vector with the provided one. */
3115void replaceClientCommandVector(client *c, int argc, robj **argv) {

Callers 11

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

Calls 3

zmallocFunction · 0.85
incrRefCountFunction · 0.85

Tested by

no test coverage detected