Completely replace the client command vector with the provided one. */
| 3113 | |
| 3114 | /* Completely replace the client command vector with the provided one. */ |
| 3115 | void 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. |
no test coverage detected