unsigned long count(const char * const str, char a)
{
unsigned long n = 0;
- for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+ for (const char *p = str; *p; ++p)
{
if (*p == '?')
++n;
~ModuleSQL();
unsigned long NewID();
const char* OnRequest(Request* request);
- void OnRehash(User* user, const std::string ¶meter);
+ void OnRehash(User* user);
Version GetVersion();
};
if (!ServerInstance->Modules->PublishFeature("SQL", this))
{
- /* Tell worker thread to exit NOW,
- * Automatically joins */
+ Dispatcher->join();
delete Dispatcher;
ServerInstance->Modules->DoneWithInterface("SQLutils");
throw ModuleException("m_mysql: Unable to publish feature 'SQL'");
return NULL;
}
-void ModuleSQL::OnRehash(User* user, const std::string ¶meter)
+void ModuleSQL::OnRehash(User* user)
{
Dispatcher->LockQueue();
rehashing = true;
{
LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
+ SQLConnection* conn = NULL;
+
this->LockQueue();
while (!this->GetExitFlag())
{
LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
}
+ conn = NULL;
Parent->ConnMutex.Lock();
for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++)
{
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++)
{