X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ca6e4bad852f8eb986cf38eef3a3f2366134e45d..53c1823aaef2eb8d547a8eed8cfe12fe7204ca79:/projects/stargazer/plugins/other/radius/radius.cpp diff --git a/projects/stargazer/plugins/other/radius/radius.cpp b/projects/stargazer/plugins/other/radius/radius.cpp index efa99570..6a02ce4f 100644 --- a/projects/stargazer/plugins/other/radius/radius.cpp +++ b/projects/stargazer/plugins/other/radius/radius.cpp @@ -121,36 +121,26 @@ return 0; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- RADIUS::RADIUS() - : nonstop(false), + : ctx(), + errorStr(), + radSettings(), + settings(), + authServices(), + acctServices(), + sessions(), + nonstop(false), isRunning(false), users(NULL), stgSettings(NULL), store(NULL), - sock(-1) + thread(), + mutex(), + sock(-1), + packet() { InitEncrypt(&ctx, ""); } //----------------------------------------------------------------------------- -void RADIUS::SetUsers(USERS * u) -{ -users = u; -} -//----------------------------------------------------------------------------- -void RADIUS::SetStgSettings(const SETTINGS * s) -{ -stgSettings = s; -} -//----------------------------------------------------------------------------- -void RADIUS::SetSettings(const MODULE_SETTINGS & s) -{ -settings = s; -} -//----------------------------------------------------------------------------- -void RADIUS::SetStore(STORE * s) -{ -store = s; -} -//----------------------------------------------------------------------------- int RADIUS::ParseSettings() { int ret = radSettings.ParseSettings(settings); @@ -159,27 +149,6 @@ if (ret) return ret; } //----------------------------------------------------------------------------- -bool RADIUS::IsRunning() -{ -return isRunning; -} -//----------------------------------------------------------------------------- -const std::string RADIUS::GetVersion() const -{ -return "RADIUS data access plugin v 0.6"; -} -//----------------------------------------------------------------------------- -uint16_t RADIUS::GetStartPosition() const -{ -// Start before any authorizers!!! -return 20; -} -//----------------------------------------------------------------------------- -uint16_t RADIUS::GetStopPosition() const -{ -return 20; -} -//----------------------------------------------------------------------------- int RADIUS::PrepareNet() { sock = socket(AF_INET, SOCK_DGRAM, 0); @@ -267,7 +236,8 @@ if (isRunning) //5 seconds to thread stops itself for (int i = 0; i < 25 && isRunning; i++) { - usleep(200000); + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); } //after 5 seconds waiting thread still running. now killing it