rio fdset target: handle short writes.

While the socket is set in blocking mode, we still can get short writes
writing to a socket.
This commit is contained in:
antirez
2014-10-17 16:45:48 +02:00
parent 74f90c6123
commit 525c488f63
3 changed files with 18 additions and 2 deletions

View File

@ -888,6 +888,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
}
nread = read(fd,buf,readlen);
printf("NREAD %d (%d)\n", (int)nread, (int)readlen);
if (nread <= 0) {
redisLog(REDIS_WARNING,"I/O error trying to sync with MASTER: %s",
(nread == -1) ? strerror(errno) : "connection lost");