From 75f24a5d161c32626ded6eb61e605e4e33b5287d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 30 Jan 2015 15:50:07 +1100 Subject: [PATCH] Cope with a socket line that is closed at the end of the message --- src/ckpool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ckpool.c b/src/ckpool.c index 52921577..de6d41c0 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -428,6 +428,9 @@ int read_socket_line(connsock_t *cs, const int timeout) } ret = recv(fd, readbuf, PAGESIZE - 4, 0); if (ret < 1) { + /* Closed socket after valid message */ + if (!ret && eom) + break; LOGERR("Failed to recv in read_socket_line"); ret = -1; goto out;