summaryrefslogtreecommitdiff
path: root/src/replication.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-11-08 13:27:34 +0100
committerantirez <antirez@gmail.com>2019-01-09 17:00:29 +0100
commit07bce54093b29342f63d7a4a250ebc626dae5343 (patch)
treef11ddd602159548be533d5ada0c57394a9febc91 /src/replication.c
parent073293693e84b412ad3eaed392f79643a4b2d7a5 (diff)
downloadredis-07bce54093b29342f63d7a4a250ebc626dae5343.tar.gz
RESP3: Use new deferred len API in replication.c.
Diffstat (limited to 'src/replication.c')
-rw-r--r--src/replication.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/replication.c b/src/replication.c
index a3110661e..9508528d1 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -263,7 +263,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
* or are already in sync with the master. */
/* Add the multi bulk length. */
- addReplyMultiBulkLen(slave,argc);
+ addReplyArrayLen(slave,argc);
/* Finally any additional argument that was not stored inside the
* static buffer if any (from j to argc). */
@@ -2062,10 +2062,10 @@ void roleCommand(client *c) {
void *mbcount;
int slaves = 0;
- addReplyMultiBulkLen(c,3);
+ addReplyArrayLen(c,3);
addReplyBulkCBuffer(c,"master",6);
addReplyLongLong(c,server.master_repl_offset);
- mbcount = addDeferredMultiBulkLength(c);
+ mbcount = addReplyDeferredLen(c);
listRewind(server.slaves,&li);
while((ln = listNext(&li))) {
client *slave = ln->value;
@@ -2077,17 +2077,17 @@ void roleCommand(client *c) {
slaveip = ip;
}
if (slave->replstate != SLAVE_STATE_ONLINE) continue;
- addReplyMultiBulkLen(c,3);
+ addReplyArrayLen(c,3);
addReplyBulkCString(c,slaveip);
addReplyBulkLongLong(c,slave->slave_listening_port);
addReplyBulkLongLong(c,slave->repl_ack_off);
slaves++;
}
- setDeferredMultiBulkLength(c,mbcount,slaves);
+ setDeferredArrayLen(c,mbcount,slaves);
} else {
char *slavestate = NULL;
- addReplyMultiBulkLen(c,5);
+ addReplyArrayLen(c,5);
addReplyBulkCBuffer(c,"slave",5);
addReplyBulkCString(c,server.masterhost);
addReplyLongLong(c,server.masterport);
@@ -2116,7 +2116,7 @@ void replicationSendAck(void) {
if (c != NULL) {
c->flags |= CLIENT_MASTER_FORCE_REPLY;
- addReplyMultiBulkLen(c,3);
+ addReplyArrayLen(c,3);
addReplyBulkCString(c,"REPLCONF");
addReplyBulkCString(c,"ACK");
addReplyBulkLongLong(c,c->reploff);