X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/27ac6cd34ada410ecfb322007fa0a9f16a777a89..adda4265c88314b4c78e2d46129ca09534931ede:/projects/stargazer/plugins/other/smux/smux.cpp?ds=inline diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp index c5d5132b..9ff739cb 100644 --- a/projects/stargazer/plugins/other/smux/smux.cpp +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -24,9 +24,6 @@ namespace { PLUGIN_CREATOR smc; -bool SPrefixLess(const Sensors::value_type & a, - const Sensors::value_type & b); - bool SPrefixLess(const Sensors::value_type & a, const Sensors::value_type & b) { @@ -57,7 +54,7 @@ int p; pv.param = "Port"; pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'Port\' not found."; printfd(__FILE__, "Parameter 'Port' not found\n"); @@ -73,7 +70,7 @@ port = static_cast(p); pv.param = "Password"; pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'Password\' not found."; printfd(__FILE__, "Parameter 'Password' not found\n"); @@ -86,7 +83,7 @@ else pv.param = "Server"; pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) +if (pvi == s.moduleParams.end() || pvi->value.empty()) { errorStr = "Parameter \'Server\' not found."; printfd(__FILE__, "Parameter 'Server' not found\n"); @@ -278,7 +275,11 @@ if (Stop()) return -1; if (Start()) return -1; -logger("Reconnected successfully."); +if (!needReconnect) + { + printfd(__FILE__, "SMUX reconnected succesfully.\n"); + logger("Reconnected successfully."); + } return 0; }