summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-11-21 11:35:50 +0100
committerantirez <antirez@gmail.com>2013-11-21 15:24:15 +0100
commit46e2f3468caa4dc71f136ddaea4d4fad10682c51 (patch)
tree2c73a71872518db5bfe462fc403cae22c5546613
parent87098a39f01ad3cbcb1ea0397c7667f25f2b010f (diff)
downloadredis-46e2f3468caa4dc71f136ddaea4d4fad10682c51.tar.gz
Sentinel: check for disconnected links in sentinelSendHello().
Does not fix any bug as the test is performed by the caller, but better to have the check.
-rw-r--r--src/sentinel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index d3054b0c3..d9ffe7cbf 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -2071,6 +2071,7 @@ int sentinelSendHello(sentinelRedisInstance *ri) {
/* Try to obtain our own IP address. */
if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) == -1) return REDIS_ERR;
+ if (ri->flags & SRI_DISCONNECTED) return;
/* Format and send the Hello message. */
snprintf(payload,sizeof(payload),