X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/f892797e1b459ad568df32d891b368302c40b3c9..06851a93de54c4d9bb0a6c52234ef5bb3db07d96:/src/replication.c?ds=sidebyside diff --git a/src/replication.c b/src/replication.c index f474d982..222032cf 100644 --- a/src/replication.c +++ b/src/replication.c @@ -3,6 +3,7 @@ #include #include #include +#include #include /* ---------------------------------- MASTER -------------------------------- */ @@ -26,8 +27,8 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) { robj *selectcmd; if (dictid >= 0 && dictid < REDIS_SHARED_SELECT_CMDS) { - incrRefCount(shared.select[dictid]); selectcmd = shared.select[dictid]; + incrRefCount(selectcmd); } else { selectcmd = createObject(REDIS_STRING, sdscatprintf(sdsempty(),"select %d\r\n",dictid)); @@ -53,10 +54,12 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj ** gettimeofday(&tv,NULL); cmdrepr = sdscatprintf(cmdrepr,"%ld.%06ld ",(long)tv.tv_sec,(long)tv.tv_usec); if (c->flags & REDIS_LUA_CLIENT) { - cmdrepr = sdscatprintf(cmdrepr,"[%d lua] ", dictid); + cmdrepr = sdscatprintf(cmdrepr,"[%d lua] ",dictid); + } else if (c->flags & REDIS_UNIX_SOCKET) { + cmdrepr = sdscatprintf(cmdrepr,"[%d unix:%s] ",dictid,server.unixsocket); } else { anetPeerToString(c->fd,ip,&port); - cmdrepr = sdscatprintf(cmdrepr,"[%d %s:%d] ", dictid,ip,port); + cmdrepr = sdscatprintf(cmdrepr,"[%d %s:%d] ",dictid,ip,port); } for (j = 0; j < argc; j++) { @@ -145,6 +148,46 @@ void syncCommand(redisClient *c) { return; } +/* REPLCONF