diff options
author | Adam <Adam@anope.org> | 2011-08-20 00:57:35 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-20 00:57:35 -0400 |
commit | 46639707221fb1af96ca60c717e2e4400818e8f7 (patch) | |
tree | 7d7d3f5074e23cc520872e443ae83971e059b5fd /modules/database/db_mysql_live.cpp | |
parent | a68d17c17e904881b580d29290ae37bb2627b51b (diff) |
Removed m_async_commands, it can still cause crashes from invalid pointers on the stack & is a giant mess anyway
Diffstat (limited to 'modules/database/db_mysql_live.cpp')
-rw-r--r-- | modules/database/db_mysql_live.cpp | 80 |
1 files changed, 7 insertions, 73 deletions
diff --git a/modules/database/db_mysql_live.cpp b/modules/database/db_mysql_live.cpp index 07b9b037c..d320b5001 100644 --- a/modules/database/db_mysql_live.cpp +++ b/modules/database/db_mysql_live.cpp @@ -1,5 +1,4 @@ #include "module.h" -#include "../extra/async_commands.h" #include "../extra/sql.h" class SQLCache : public Timer @@ -136,7 +135,6 @@ static void NickCoreUpdate(const SQLResult &res) class MySQLLiveModule : public Module { service_reference<SQLProvider> SQL; - service_reference<AsynchCommandsService> ACS; SQLCache chan_cache, nick_cache, core_cache; @@ -151,16 +149,9 @@ class MySQLLiveModule : public Module return res; } - CommandMutex *CurrentCommand() - { - if (this->ACS) - return this->ACS->CurrentCommand(); - return NULL; - } - public: MySQLLiveModule(const Anope::string &modname, const Anope::string &creator) : - Module(modname, creator, DATABASE), SQL("mysql/main"), ACS("asynch_commands") + Module(modname, creator, DATABASE), SQL("mysql/main") { Implementation i[] = { I_OnFindChan, I_OnFindNick, I_OnFindCore, I_OnShutdown }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); @@ -182,27 +173,8 @@ class MySQLLiveModule : public Module { SQLQuery query("SELECT * FROM `anope_cs_info` WHERE `name` = @name"); query.setValue("name", chname); - CommandMutex *current_command = this->CurrentCommand(); - if (current_command) - { - current_command->Unlock(); - try - { - SQLResult res = this->RunQuery(query); - current_command->Lock(); - ChanInfoUpdate(res); - } - catch (const SQLException &) - { - current_command->Lock(); - throw; - } - } - else - { - SQLResult res = this->RunQuery(query); - ChanInfoUpdate(res); - } + SQLResult res = this->RunQuery(query); + ChanInfoUpdate(res); } catch (const SQLException &ex) { @@ -219,27 +191,8 @@ class MySQLLiveModule : public Module { SQLQuery query("SELECT * FROM `anope_ns_alias` WHERE `nick` = @nick"); query.setValue("nick", nick); - CommandMutex *current_command = this->CurrentCommand(); - if (current_command) - { - current_command->Unlock(); - try - { - SQLResult res = this->RunQuery(query); - current_command->Lock(); - NickInfoUpdate(res); - } - catch (const SQLException &) - { - current_command->Lock(); - throw; - } - } - else - { - SQLResult res = this->RunQuery(query); - NickInfoUpdate(res); - } + SQLResult res = this->RunQuery(query); + NickInfoUpdate(res); } catch (const SQLException &ex) { @@ -256,27 +209,8 @@ class MySQLLiveModule : public Module { SQLQuery query("SELECT * FROM `anope_ns_core` WHERE `display` = @display"); query.setValue("display", nick); - CommandMutex *current_command = this->CurrentCommand(); - if (current_command) - { - current_command->Unlock(); - try - { - SQLResult res = this->RunQuery(query); - current_command->Lock(); - NickCoreUpdate(res); - } - catch (const SQLException &) - { - current_command->Lock(); - throw; - } - } - else - { - SQLResult res = this->RunQuery(query); - NickCoreUpdate(res); - } + SQLResult res = this->RunQuery(query); + NickCoreUpdate(res); } catch (const SQLException &ex) { |