X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/46b0747592074017ff0ea4b33d4a7194235886e5..611c8051a2ae58a1c306675c8250865e12563834:/stargazer/plugins/other/radius/conn.cpp diff --git a/stargazer/plugins/other/radius/conn.cpp b/stargazer/plugins/other/radius/conn.cpp index a209409b..4b2f0dcf 100644 --- a/stargazer/plugins/other/radius/conn.cpp +++ b/stargazer/plugins/other/radius/conn.cpp @@ -41,6 +41,11 @@ #include #include +#ifndef MSG_NOSIGNAL +// On OSX this flag does not exist. +#define MSG_NOSIGNAL 0 +#endif + using STG::Conn; using STG::Config; using STG::JSON::Parser; @@ -226,7 +231,7 @@ std::string toString(Config::ReturnCode code) class Conn::Impl { public: - Impl(USERS& users, PLUGIN_LOGGER& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote); + Impl(Users& users, PluginLogger& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote); ~Impl(); int sock() const { return m_sock; } @@ -237,8 +242,8 @@ class Conn::Impl bool isOk() const { return m_ok; } private: - USERS& m_users; - PLUGIN_LOGGER& m_logger; + Users& m_users; + PluginLogger& m_logger; RADIUS& m_plugin; const Config& m_config; int m_sock; @@ -273,7 +278,7 @@ class Conn::Impl void processPing(); void processPong(); void processData(); - bool answer(const USER& user); + bool answer(const User& user); bool answerNo(); bool sendPing(); bool sendPong(); @@ -281,7 +286,7 @@ class Conn::Impl static bool write(void* data, const char* buf, size_t size); }; -Conn::Conn(USERS& users, PLUGIN_LOGGER& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote) +Conn::Conn(Users& users, PluginLogger& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote) : m_impl(new Impl(users, logger, plugin, config, fd, remote)) { } @@ -310,7 +315,7 @@ bool Conn::isOk() const return m_impl->isOk(); } -Conn::Impl::Impl(USERS& users, PLUGIN_LOGGER& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote) +Conn::Impl::Impl(Users& users, PluginLogger& logger, RADIUS& plugin, const Config& config, int fd, const std::string& remote) : m_users(users), m_logger(logger), m_plugin(plugin), @@ -417,7 +422,7 @@ void Conn::Impl::processData() printfd(__FILE__, "Got data.\n"); int handle = m_users.OpenSearch(); - USER_PTR user = NULL; + User* user = NULL; bool matched = false; while (m_users.SearchNext(handle, &user) == 0) { @@ -456,7 +461,7 @@ void Conn::Impl::processData() m_users.CloseSearch(handle); } -bool Conn::Impl::answer(const USER& user) +bool Conn::Impl::answer(const User& user) { printfd(__FILE__, "Got match. Sending answer...\n"); MapGen replyData;