From 511ce8ba87df1cfb262b5809f3dab772595c4b0a Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 5 Mar 2010 22:21:29 +0000 Subject: 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 --- src/modules/extra/m_mysql.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/modules/extra/m_mysql.cpp') 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; - - ModuleSQL(); - ~ModuleSQL(); - unsigned long NewID(); - void OnRequest(Request& request); - void OnRehash(User* user); - Version GetVersion(); + int currid; + bool rehashing; + DispatcherThread* Dispatcher; + Mutex ResultsMutex; + Mutex LoggingMutex; + Mutex ConnMutex; + ServiceProvider sqlserv; + + 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); -- cgit v1.3.1-10-gc9f91