summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-12-13 10:19:38 +0100
committerantirez <antirez@gmail.com>2015-12-13 10:23:04 +0100
commita5d27d395f10f09670db1bfe8776b82a837b2a95 (patch)
tree3a40474e58583e7231f9b88912865e42e2fad97f
parentea897338332acb7b81d4f51dad3e9c9f291b2443 (diff)
downloadredis-a5d27d395f10f09670db1bfe8776b82a837b2a95.tar.gz
Fix 3.0 merge issues with new MIGRATE.
-rw-r--r--src/db.c2
-rw-r--r--src/networking.c10
-rw-r--r--src/redis.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index b4788e931..df1b19519 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1133,7 +1133,7 @@ int *sortGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys)
int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
int i, num, first, *keys;
- UNUSED(cmd);
+ REDIS_NOTUSED(cmd);
/* Assume the obvious form. */
first = 3;
diff --git a/src/networking.c b/src/networking.c
index acffd5371..6d9cb936d 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -1527,6 +1527,16 @@ void rewriteClientCommandVector(redisClient *c, int argc, ...) {
va_end(ap);
}
+/* Completely replace the client command vector with the provided one. */
+void replaceClientCommandVector(redisClient *c, int argc, robj **argv) {
+ freeClientArgv(c);
+ zfree(c->argv);
+ c->argv = argv;
+ c->argc = argc;
+ c->cmd = lookupCommandOrOriginal(c->argv[0]->ptr);
+ redisAssertWithInfo(c,NULL,c->cmd != NULL);
+}
+
/* Rewrite a single item in the command vector.
* The new val ref count is incremented, and the old decremented.
*
diff --git a/src/redis.h b/src/redis.h
index 76a707c11..6eb3ee8ec 100644
--- a/src/redis.h
+++ b/src/redis.h
@@ -1071,6 +1071,7 @@ sds catClientInfoString(sds s, redisClient *client);
sds getAllClientsInfoString(void);
void rewriteClientCommandVector(redisClient *c, int argc, ...);
void rewriteClientCommandArgument(redisClient *c, int i, robj *newval);
+void replaceClientCommandVector(redisClient *c, int argc, robj **argv);
unsigned long getClientOutputBufferMemoryUsage(redisClient *c);
void freeClientsInAsyncFreeQueue(void);
void asyncCloseClientOnOutputBufferLimitReached(redisClient *c);