From 8b435d7400902700ba80af09e0c5e0eb85257862 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Fri, 20 Dec 2013 16:01:29 +0100 Subject: [PATCH] rocksock_readline: act properly on remote disconnect --- rocksock_readline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocksock_readline.c b/rocksock_readline.c index 7042c2a..597011b 100644 --- a/rocksock_readline.c +++ b/rocksock_readline.c @@ -29,7 +29,7 @@ int rocksock_readline(rocksock* sock, char* buffer, size_t bufsize, size_t* byte *bytesread = 0; while(*bytesread < bufsize) { ret = rocksock_recv(sock, ptr, 1, 1, &bytesread2); - if(ret) return ret; + if(ret || !bytesread2) return ret; *bytesread += bytesread2; if(ptr > buffer + bufsize) break; -- 2.11.4.GIT