aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
authorGravatar danieldg2010-03-05 22:21:29 +0000
committerGravatar danieldg2010-03-05 22:21:29 +0000
commit511ce8ba87df1cfb262b5809f3dab772595c4b0a (patch)
treec40085291a2cff3822a94f16955b56c4740982df /src/modules/extra/m_mysql.cpp
parentFix variable shadowing warning (diff)
downloadinspircd++-511ce8ba87df1cfb262b5809f3dab772595c4b0a.tar.gz
inspircd++-511ce8ba87df1cfb262b5809f3dab772595c4b0a.tar.bz2
inspircd++-511ce8ba87df1cfb262b5809f3dab772595c4b0a.zip
Fix SQL modules not all using AddService, noticed by Morpheus
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12595 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r--src/modules/extra/m_mysql.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index befe11df1..731753d9b 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -87,20 +87,21 @@ static unsigned long count(const char * const str, char a)
class ModuleSQL : public Module
{
public:
- int currid;
- bool rehashing;
- DispatcherThread* Dispatcher;
- Mutex ResultsMutex;
- Mutex LoggingMutex;
- Mutex ConnMutex;
- ServiceProvider sqlserv;
+ int currid;
+ bool rehashing;
+ DispatcherThread* Dispatcher;
+ Mutex ResultsMutex;
+ Mutex LoggingMutex;
+ Mutex ConnMutex;
+ ServiceProvider sqlserv;
- ModuleSQL();
- ~ModuleSQL();
- unsigned long NewID();
- void OnRequest(Request& request);
- void OnRehash(User* user);
- Version GetVersion();
+ ModuleSQL();
+ void init();
+ ~ModuleSQL();
+ unsigned long NewID();
+ void OnRequest(Request& request);
+ void OnRehash(User* user);
+ Version GetVersion();
};
@@ -681,6 +682,12 @@ class DispatcherThread : public SocketThread
ModuleSQL::ModuleSQL() : rehashing(false), sqlserv(this, "SQL/mysql", SERVICE_DATA)
{
currid = 0;
+ Dispatcher = NULL;
+}
+
+void ModuleSQL::init()
+{
+ ServerInstance->Modules->AddService(sqlserv);
Dispatcher = new DispatcherThread(this);
ServerInstance->Threads->Start(Dispatcher);