From 52c2acfc00fe7ddad7180b9300a3e89fa8299e24 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sat, 9 Nov 2013 14:23:55 +0200 Subject: [PATCH] Fixed disconnecting users in rscriptd. --- .../stargazer/plugins/other/rscript/rscript.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index fb8cb57c..3bc90792 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -629,14 +629,25 @@ authorizedUsers.insert(std::make_pair(user->GetCurrIP(), rsu)); void REMOTE_SCRIPT::DelRSU(USER_PTR user) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); -const std::map::iterator it( +std::map::iterator it(authorizedUsers.begin()); +while (it != authorizedUsers.end()) + { + if (it->second.user == user) + { + Send(it->second, true); + authorizedUsers.erase(it); + return; + } + ++it; + } +/*const std::map::iterator it( authorizedUsers.find(user->GetCurrIP()) ); if (it != authorizedUsers.end()) { Send(it->second, true); authorizedUsers.erase(it); - } + }*/ } //----------------------------------------------------------------------------- void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue) -- 2.44.2