slave now detect lost connection during SYNC, fixing Issue 173

This commit is contained in:
antirez 2010-08-24 16:25:00 +02:00
parent 778b2210a9
commit b91d605a35

View File

@ -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;