--- a/src/server/util/netbuf.c Tue Aug 13 22:14:32 2019 +0200 +++ b/src/server/util/netbuf.c Thu Oct 31 10:26:35 2019 +0100 @@ -143,7 +143,11 @@ return bytes_in_buffer; } } - + + if(!buf->sd) { + return NETBUF_EOF; + } + /* The netbuf is empty. Read data directly into the caller's buffer */ bytes = net_read(buf->sd, buffer, size); if (bytes == 0)