summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_mssql.cpp26
-rw-r--r--src/modules/extra/m_pgsql.cpp28
-rw-r--r--src/modules/extra/m_sqlite3.cpp8
3 files changed, 31 insertions, 31 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp
index d52744fe4..5e7662588 100644
--- a/src/modules/extra/m_mssql.cpp
+++ b/src/modules/extra/m_mssql.cpp
@@ -46,10 +46,10 @@ class QueryThread : public Thread
{
private:
ModuleMsSQL* Parent;
- InspIRCd* Instance;
+ InspIRCd* ServerInstance;
public:
QueryThread(InspIRCd* si, ModuleMsSQL* mod)
- : Thread(), Parent(mod), Instance(si)
+ : Thread(), Parent(mod), ServerInstance(si)
{
}
~QueryThread() { }
@@ -68,7 +68,7 @@ class ResultNotifier : public BufferedSocket
virtual bool OnDataReady()
{
char data = 0;
- if (Instance->SE->Recv(this, &data, 1, 0) > 0)
+ if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0)
{
Dispatch();
return true;
@@ -285,7 +285,7 @@ class SQLConn : public classbase
{
private:
ResultQueue results;
- InspIRCd* Instance;
+ InspIRCd* ServerInstance;
Module* mod;
SQLhost host;
TDSLOGIN* login;
@@ -296,7 +296,7 @@ class SQLConn : public classbase
QueryQueue queue;
SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
- : Instance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
+ : ServerInstance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
{
if (OpenDB())
{
@@ -306,7 +306,7 @@ class SQLConn : public classbase
if (tds_process_simple_query(sock) != TDS_SUCCEED)
{
LoggingMutex->Lock();
- Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
+ ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
LoggingMutex->Unlock();
CloseDB();
}
@@ -314,7 +314,7 @@ class SQLConn : public classbase
else
{
LoggingMutex->Lock();
- Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
+ ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
LoggingMutex->Unlock();
CloseDB();
}
@@ -322,7 +322,7 @@ class SQLConn : public classbase
else
{
LoggingMutex->Lock();
- Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not connect to DB with id: " + host.id);
+ ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not connect to DB with id: " + host.id);
LoggingMutex->Unlock();
CloseDB();
}
@@ -414,7 +414,7 @@ class SQLConn : public classbase
char* msquery = strdup(req.query.q.data());
LoggingMutex->Lock();
- Instance->Logs->Log("m_mssql",DEBUG,"doing Query: %s",msquery);
+ ServerInstance->Logs->Log("m_mssql",DEBUG,"doing Query: %s",msquery);
LoggingMutex->Unlock();
if (tds_submit_query(sock, msquery) != TDS_SUCCEED)
{
@@ -430,8 +430,8 @@ class SQLConn : public classbase
int tds_res;
while (tds_process_tokens(sock, &tds_res, NULL, TDS_TOKEN_RESULTS) == TDS_SUCCEED)
{
- //Instance->Logs->Log("m_mssql",DEBUG,"<******> result type: %d", tds_res);
- //Instance->Logs->Log("m_mssql",DEBUG,"AFFECTED ROWS: %d", sock->rows_affected);
+ //ServerInstance->Logs->Log("m_mssql",DEBUG,"<******> result type: %d", tds_res);
+ //ServerInstance->Logs->Log("m_mssql",DEBUG,"AFFECTED ROWS: %d", sock->rows_affected);
switch (tds_res)
{
case TDS_ROWFMT_RESULT:
@@ -494,7 +494,7 @@ class SQLConn : public classbase
{
SQLConn* sc = (SQLConn*)pContext->parent;
LoggingMutex->Lock();
- sc->Instance->Logs->Log("m_mssql", DEBUG, "Message for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
+ sc->ServerInstance->Logs->Log("m_mssql", DEBUG, "Message for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
LoggingMutex->Unlock();
return 0;
}
@@ -503,7 +503,7 @@ class SQLConn : public classbase
{
SQLConn* sc = (SQLConn*)pContext->parent;
LoggingMutex->Lock();
- sc->Instance->Logs->Log("m_mssql", DEFAULT, "Error for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
+ sc->ServerInstance->Logs->Log("m_mssql", DEFAULT, "Error for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
LoggingMutex->Unlock();
return 0;
}
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index be8598e02..2b8c218e8 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -315,7 +315,7 @@ public:
class SQLConn : public EventHandler
{
private:
- InspIRCd* Instance;
+ InspIRCd* ServerInstance;
SQLhost confhost; /* The <database> entry */
Module* us; /* Pointer to the SQL provider itself */
PGconn* sql; /* PgSQL database connection handle */
@@ -326,12 +326,12 @@ class SQLConn : public EventHandler
public:
SQLConn(InspIRCd* SI, Module* self, const SQLhost& hi)
- : EventHandler(), Instance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
+ : EventHandler(), ServerInstance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
{
- idle = this->Instance->Time();
+ idle = this->ServerInstance->Time();
if(!DoConnect())
{
- Instance->Logs->Log("m_pgsql",DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id));
+ ServerInstance->Logs->Log("m_pgsql",DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id));
DelayReconnect();
}
}
@@ -381,9 +381,9 @@ class SQLConn : public EventHandler
if(this->fd <= -1)
return false;
- if (!this->Instance->SE->AddFd(this))
+ if (!this->ServerInstance->SE->AddFd(this))
{
- Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Couldn't add pgsql socket to socket engine");
+ ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Couldn't add pgsql socket to socket engine");
return false;
}
@@ -396,7 +396,7 @@ class SQLConn : public EventHandler
switch(PQconnectPoll(sql))
{
case PGRES_POLLING_WRITING:
- Instance->SE->WantWrite(this);
+ ServerInstance->SE->WantWrite(this);
status = CWRITE;
return true;
case PGRES_POLLING_READING:
@@ -426,7 +426,7 @@ class SQLConn : public EventHandler
/* We just read stuff from the server, that counts as it being alive
* so update the idle-since time :p
*/
- idle = this->Instance->Time();
+ idle = this->ServerInstance->Time();
if (PQisBusy(sql))
{
@@ -509,7 +509,7 @@ class SQLConn : public EventHandler
switch(PQresetPoll(sql))
{
case PGRES_POLLING_WRITING:
- Instance->SE->WantWrite(this);
+ ServerInstance->SE->WantWrite(this);
status = CWRITE;
return DoPoll();
case PGRES_POLLING_READING:
@@ -621,7 +621,7 @@ class SQLConn : public EventHandler
#endif
if(error)
{
- Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
+ ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
}
/* Incremenet queryend to the end of the newly escaped parameter */
@@ -632,7 +632,7 @@ class SQLConn : public EventHandler
}
else
{
- Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Found a substitution location but no parameter to substitute :|");
+ ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Found a substitution location but no parameter to substitute :|");
break;
}
}
@@ -690,15 +690,15 @@ class SQLConn : public EventHandler
}
void Close() {
- if (!this->Instance->SE->DelFd(this))
+ if (!this->ServerInstance->SE->DelFd(this))
{
if (sql && PQstatus(sql) == CONNECTION_BAD)
{
- this->Instance->SE->DelFd(this, true);
+ this->ServerInstance->SE->DelFd(this, true);
}
else
{
- Instance->Logs->Log("m_pgsql",DEBUG, "BUG: PQsocket cant be removed from socket engine!");
+ ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: PQsocket cant be removed from socket engine!");
}
}
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 5adb9ee93..d76bc97fe 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -50,7 +50,7 @@ class ResultNotifier : public BufferedSocket
virtual bool OnDataReady()
{
char data = 0;
- if (Instance->SE->Recv(this, &data, 1, 0) > 0)
+ if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0)
{
Dispatch();
return true;
@@ -266,18 +266,18 @@ class SQLConn : public classbase
{
private:
ResultQueue results;
- InspIRCd* Instance;
+ InspIRCd* ServerInstance;
Module* mod;
SQLhost host;
sqlite3* conn;
public:
SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
- : Instance(SI), mod(m), host(hi)
+ : ServerInstance(SI), mod(m), host(hi)
{
if (OpenDB() != SQLITE_OK)
{
- Instance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
+ ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
CloseDB();
}
}