X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/daeeee5daf8488c1abd98d5a361356be873e4ac0..39c6313308afb248b140d98b8052f1b484549df2:/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp index 9ec72a1c..c0b7b325 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp @@ -26,7 +26,7 @@ * *******************************************************************/ -#include // cloase, usleep +#include // close #include #include @@ -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)); @@ -461,7 +461,7 @@ while (1) } char buffer[8]; - buffer[8] = 0; + buffer[7] = 0; DecodeString(buffer, bufferS, &ctx); requestList.push_back(std::string(buffer, pos));