Commit b91d605a authored by antirez's avatar antirez
Browse files

slave now detect lost connection during SYNC, fixing Issue 173

parent 778b2210
...@@ -428,9 +428,9 @@ int syncWithMaster(void) { ...@@ -428,9 +428,9 @@ int syncWithMaster(void) {
int nread, nwritten; int nread, nwritten;
nread = read(fd,buf,(dumpsize < 1024)?dumpsize:1024); 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", redisLog(REDIS_WARNING,"I/O error trying to sync with MASTER: %s",
strerror(errno)); (nread == -1) ? strerror(errno) : "connection lost");
close(fd); close(fd);
close(dfd); close(dfd);
return REDIS_ERR; return REDIS_ERR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment