From c4e1851f4284e21d65177185382bfbfc173070c5 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 8 Nov 2010 02:45:46 +0100 Subject: [PATCH] Fix voor afsluiten verbinding... --- util/ddv_socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/ddv_socket.cpp b/util/ddv_socket.cpp index 56e298de..4e1341d2 100644 --- a/util/ddv_socket.cpp +++ b/util/ddv_socket.cpp @@ -41,7 +41,7 @@ bool DDV_write(void * buffer, int width, int count, int sock){ int todo = width*count; while (sofar != todo){ int r = send(sock, (char*)buffer + sofar, todo-sofar, 0); - if (r < 0){ + if (r <= 0){ socketError = true; printf("Could not write! %s\n", strerror(errno)); return false; @@ -56,7 +56,7 @@ bool DDV_read(void * buffer, int width, int count, int sock){ int todo = width*count; while (sofar != todo){ int r = recv(sock, (char*)buffer + sofar, todo-sofar, 0); - if (r < 0){ + if (r <= 0){ socketError = true; printf("Could not read! %s\n", strerror(errno)); return false;