]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_mysql.cpp
OnRehash changes: split to multiple hooks to clarify use and prevent explosion of...
[user/henk/code/inspircd.git] / src / modules / extra / m_mysql.cpp
index 4fbf4f1f4a1331c95cf9ef3eddf98fb4e3abf638..465992d304578da9a7b916ad2e3cdb935970dfd3 100644 (file)
@@ -101,7 +101,7 @@ class ModuleSQL : public Module
         ~ModuleSQL();
         unsigned long NewID();
         const char* OnRequest(Request* request);
-        void OnRehash(User* user, const std::string &parameter);
+        void OnRehash(User* user);
         Version GetVersion();
 };
 
@@ -746,7 +746,7 @@ const char* ModuleSQL::OnRequest(Request* request)
        return NULL;
 }
 
-void ModuleSQL::OnRehash(User* user, const std::string &parameter)
+void ModuleSQL::OnRehash(User* user)
 {
        Dispatcher->LockQueue();
        rehashing = true;
@@ -762,6 +762,8 @@ void DispatcherThread::Run()
 {
        LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
 
+       SQLConnection* conn = NULL;
+
        this->LockQueue();
        while (!this->GetExitFlag())
        {
@@ -771,6 +773,7 @@ void DispatcherThread::Run()
                        LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
                }
 
+               conn = NULL;
                Parent->ConnMutex.Lock();
                for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++)
                {
@@ -804,9 +807,10 @@ void DispatcherThread::Run()
 
 void DispatcherThread::OnNotify()
 {
+       SQLConnection* conn;
        while (1)
        {
-               SQLConnection* conn = NULL;
+               conn = NULL;
                Parent->ConnMutex.Lock();
                for (ConnMap::iterator iter = Connections.begin(); iter != Connections.end(); iter++)
                {