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

Function replaceClientCommandVector

app/redis-6.2.6/src/networking.c:3115–3128  ·  view source on GitHub ↗

Completely replace the client command vector with the provided one. */

Source from the content-addressed store, hash-verified

3113
3114/* Completely replace the client command vector with the provided one. */
3115void replaceClientCommandVector(client *c, int argc, robj **argv) {
3116 int j;
3117 retainOriginalCommandVector(c);
3118 freeClientArgv(c);
3119 zfree(c->argv);
3120 c->argv = argv;
3121 c->argc = argc;
3122 c->argv_len_sum = 0;
3123 for (j = 0; j < c->argc; j++)
3124 if (c->argv[j])
3125 c->argv_len_sum += getStringObjectLen(c->argv[j]);
3126 c->cmd = lookupCommandOrOriginal(c->argv[0]->ptr);
3127 serverAssertWithInfo(c,NULL,c->cmd != NULL);
3128}
3129
3130/* Rewrite a single item in the command vector.
3131 * The new val ref count is incremented, and the old decremented.

Callers 4

geoaddCommandFunction · 0.85
setGenericCommandFunction · 0.85
migrateCommandFunction · 0.85

Calls 5

freeClientArgvFunction · 0.85
getStringObjectLenFunction · 0.85
lookupCommandOrOriginalFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected