Completely replace the client command vector with the provided one. */
| 3750 | |
| 3751 | /* Completely replace the client command vector with the provided one. */ |
| 3752 | void replaceClientCommandVector(client *c, int argc, robj **argv) { |
| 3753 | int j; |
| 3754 | retainOriginalCommandVector(c); |
| 3755 | freeClientArgv(c); |
| 3756 | zfree(c->argv); |
| 3757 | c->argv = argv; |
| 3758 | c->argc = argc; |
| 3759 | c->argv_len_sumActive = 0; |
| 3760 | for (j = 0; j < c->argc; j++) |
| 3761 | if (c->argv[j]) |
| 3762 | c->argv_len_sumActive += getStringObjectLen(c->argv[j]); |
| 3763 | c->cmd = lookupCommandOrOriginal((sds)ptrFromObj(c->argv[0])); |
| 3764 | serverAssertWithInfo(c,NULL,c->cmd != NULL); |
| 3765 | } |
| 3766 | |
| 3767 | /* Rewrite a single item in the command vector. |
| 3768 | * The new val ref count is incremented, and the old decremented. |
no test coverage detected