diff options
-rw-r--r-- | src/modules/extra/m_mssql.cpp | 5 | ||||
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 35 | ||||
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_sqlite3.cpp | 5 |
4 files changed, 33 insertions, 16 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 2e5dc8b7b..7561fb2d8 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -644,10 +644,13 @@ class ModuleMsSQL : public Module { LoggingMutex = new Mutex(); ResultsMutex = new Mutex(); + queryDispatcher = new QueryThread(this); + } + void init() + { ReadConf(); - queryDispatcher = new QueryThread(this); ServerInstance->Threads->Start(queryDispatcher); Implementation eventlist[] = { I_OnRehash }; 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); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index b1f6916d0..5edcfca19 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -759,9 +759,11 @@ class ModulePgSQL : public Module : currid(0), sqlserv(this, "SQL/pgsql", SERVICE_DATA) { sqlsuccess = new char[strlen(SQLSUCCESS)+1]; - strlcpy(sqlsuccess, SQLSUCCESS, strlen(SQLSUCCESS)); + } + void init() + { ReadConf(); ServerInstance->Modules->AddService(sqlserv); diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index e97e884ea..902355a23 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -452,6 +452,11 @@ class ModuleSQLite3 : public Module ModuleSQLite3() : currid(0), sqlserv(this, "SQL/sqlite", SERVICE_DATA) { + } + + void init() + { + ServerInstance->Modules->AddService(sqlserv); ReadConf(); |