summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_pgsql.cpp
diff options
context:
space:
mode:
authorGravatar w00t2008-09-21 12:56:03 +0000
committerGravatar w00t2008-09-21 12:56:03 +0000
commitad3524174350633c25dc8a4e5ffbb7066c4b8cba (patch)
tree32b54faeca449b75ae9bc9f839c36ef448c9dd57 /src/modules/extra/m_pgsql.cpp
parentFixes. Dont try and catch exceptions within the RLine ctor, we dont always wa... (diff)
Be consistent. Use ServerInstance in all places instead of 'Instance' in half. This has bugged me forever :p. I think I got all of extra/ too..
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10579 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
-rw-r--r--src/modules/extra/m_pgsql.cpp28
1 files changed, 14 insertions, 14 deletions
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!");
}
}