X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d7a542f962802ad207d823b7e805c9135c1693e3..02f215c550418f180d0d1b2694c99a7a8d4dc4b2:/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 f494ee40..16a1cefa 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp @@ -171,13 +171,11 @@ while (nonstop) close(outerSocket); continue; } - if (RecvLogin(outerSocket) < 0) { close(outerSocket); continue; } - if (state == confLoginCipher) { if (SendLoginAnswer(outerSocket) < 0) @@ -190,7 +188,6 @@ while (nonstop) close(outerSocket); continue; } - if (state == confData) { if (SendLoginSAnswer(outerSocket, ans_ok) < 0) @@ -243,7 +240,7 @@ int CONFIGPROTO::RecvHdr(int sock) char buf[sizeof(STG_HEADER)]; memset(buf, 0, sizeof(STG_HEADER)); int ret; -size_t stgHdrLen = sizeof(STG_HEADER); +size_t stgHdrLen = sizeof(STG_HEADER) - 1; // Without 0-char for (size_t i = 0; i < stgHdrLen; i++) { ret = recv(sock, &buf[i], 1, 0); @@ -317,7 +314,7 @@ if (ret < ADM_LOGIN_LEN) return ENODATA; } -if (admins->FindAdmin(login, &currAdmin)) +if (admins->Find(login, &currAdmin)) { // Admin not found state = confHdr;