Fixed issue 72 (SLAVEOF shutdowns redis-server on malformed reply)

This commit is contained in:
antirez 2009-10-29 11:38:32 +01:00
parent 6c9385e01d
commit 4aa701c11a

View File

@ -5071,6 +5071,11 @@ static int syncWithMaster(void) {
strerror(errno));
return REDIS_ERR;
}
if (buf[0] != '$') {
close(fd);
redisLog(REDIS_WARNING,"Bad protocol from MASTER, the first byte is not '$', are you sure the host and port are right?");
return REDIS_ERR;
}
dumpsize = atoi(buf+1);
redisLog(REDIS_NOTICE,"Receiving %d bytes data dump from MASTER",dumpsize);
/* Read the bulk write data on a temp file */