*
*******************************************************************/
-#include <unistd.h> // cloase, usleep
+#include <unistd.h> // close
#include <cerrno>
#include <csignal>
return -1;
}
int ret = recv(sock, &buf[pos], stgHdrLen - pos, 0);
- if (ret < 0)
+ if (ret <= 0)
{
state = confHdr;
return -1;
int ret = recv(sock, &login[pos], ADM_LOGIN_LEN - pos, 0);
- if (ret < 0)
+ if (ret <= 0)
{
// Error in network
state = confHdr;
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));
}
char buffer[8];
- buffer[8] = 0;
+ buffer[7] = 0;
DecodeString(buffer, bufferS, &ctx);
requestList.push_back(std::string(buffer, pos));