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 23bf435f54
commit a7d0137075
3 changed files with 18 additions and 2 deletions

View File

@ -882,6 +882,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");