From d46639a4f8fc1477d848906e20483b66447a146d Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 6 Feb 2012 10:47:31 +0200 Subject: [PATCH] Check End-Of-Transmission read result --- .../stargazer/plugins/configuration/sgconfig/rsconf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp index 421fc7bb..c0b7b325 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp @@ -250,7 +250,7 @@ while (pos < stgHdrLen) return -1; } int ret = recv(sock, &buf[pos], stgHdrLen - pos, 0); - if (ret < 0) + if (ret <= 0) { state = confHdr; return -1; @@ -310,7 +310,7 @@ while (pos < ADM_LOGIN_LEN) { int ret = recv(sock, &login[pos], ADM_LOGIN_LEN - pos, 0); - if (ret < 0) + if (ret <= 0) { // Error in network state = confHdr; @@ -359,7 +359,7 @@ while (pos < ADM_LOGIN_LEN) int ret = recv(sock, &loginS[pos], ADM_LOGIN_LEN - pos, 0); - if (ret < 0) + if (ret <= 0) { // Network error printfd(__FILE__, "recv error: '%s'\n", strerror(errno)); -- 2.44.2