- else
- {
- req->error.Id(BAD_DBID);
- }
-
- pthread_mutex_unlock(&queue_mutex);
- /* XXX: Unlock */
-
- return returnval;
- }
-
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
-
- return NULL;
- }
-
- ModuleSQL(InspIRCd* Me)
- : Module::Module(Me)
- {
-
- Conf = new ConfigReader(ServerInstance);
- PublicServerInstance = ServerInstance;
- currid = 0;
- SQLModule = this;
-
- MessagePipe = new Notifier(ServerInstance);
- ServerInstance->Log(DEBUG,"Bound notifier to 127.0.0.1:%d",MessagePipe->GetPort());
-
- pthread_attr_t attribs;
- pthread_attr_init(&attribs);
- pthread_attr_setdetachstate(&attribs, PTHREAD_CREATE_DETACHED);
- if (pthread_create(&this->Dispatcher, &attribs, DispatcherThread, (void *)this) != 0)
- {
- throw ModuleException("m_mysql: Failed to create dispatcher thread: " + std::string(strerror(errno)));
- }
- if (!ServerInstance->PublishFeature("SQL", this))
- {
- /* Tell worker thread to exit NOW */
- giveup = true;
- throw ModuleException("m_mysql: Unable to publish feature 'SQL'");