From b91d605a35c294573f0213c89c421d09b538c2b6 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 24 Aug 2010 16:25:00 +0200 Subject: [PATCH] slave now detect lost connection during SYNC, fixing Issue 173 --- src/replication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/replication.c b/src/replication.c index 89375820..363ce54a 100644 --- a/src/replication.c +++ b/src/replication.c @@ -428,9 +428,9 @@ int syncWithMaster(void) { int nread, nwritten; nread = read(fd,buf,(dumpsize < 1024)?dumpsize:1024); - if (nread == -1) { + if (nread <= 0) { redisLog(REDIS_WARNING,"I/O error trying to sync with MASTER: %s", - strerror(errno)); + (nread == -1) ? strerror(errno) : "connection lost"); close(fd); close(dfd); return REDIS_ERR; -- 2.45.2