From eba4775b5d5bcb66e78f93d8b592076d712ed2cd Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 12 Nov 2013 11:10:10 +0100 Subject: [PATCH] Sentinel: fix PUBLISH to masters and slaves. --- src/sentinel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentinel.c b/src/sentinel.c index d80d1546..294c9cb1 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -1829,13 +1829,13 @@ void sentinelPingInstance(sentinelRedisInstance *ri) { if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) != -1) { char payload[REDIS_IP_STR_LEN+1024]; sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ? - NULL : ri->master; + ri : ri->master; snprintf(payload,sizeof(payload), "%s,%d,%s,%d,%llu," /* Info about this sentinel. */ "%s,%s,%d,%lld", /* Info about current master. */ ip, server.port, server.runid, - (ri->flags & SRI_CAN_FAILOVER) != 0, + (master->flags & SRI_CAN_FAILOVER) != 0, (unsigned long long) sentinel.current_epoch, /* --- */ master->name,master->addr->ip,master->addr->port,