summaryrefslogtreecommitdiff
path: root/src/replication.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/replication.c')
-rw-r--r--src/replication.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/replication.c b/src/replication.c
index 6e89d8739..06cfe89ae 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -588,6 +588,19 @@ void replconfCommand(redisClient *c) {
&port,NULL) != REDIS_OK))
return;
c->slave_listening_port = port;
+ } else if (!strcasecmp(c->argv[j]->ptr,"ack")) {
+ /* REPLCONF ACK is used by slave to inform the master the amount
+ * of replication stream that it processed so far. It is an
+ * internal only command that normal clients should never use. */
+ long long offset;
+
+ if (!(c->flags & REDIS_SLAVE)) return;
+ if ((getLongLongFromObject(c->argv[j+1], &offset) != REDIS_OK))
+ return;
+ if (offset > c->repl_ack_off)
+ c->repl_ack_off = offset;
+ c->repl_ack_time = server.unixtime;
+ /* Note: this command does not reply anything! */
} else {
addReplyErrorFormat(c,"Unrecognized REPLCONF option: %s",
(char*)c->argv[j]->ptr);