private:
Module* mod;
public:
- ReconnectTimer(InspIRCd* SI, Module* m)
+ ReconnectTimer(Module* m)
: Timer(5, SI->Time(), false), mod(m)
{
}
class SQLConn : public EventHandler
{
private:
- InspIRCd* ServerInstance;
SQLhost confhost; /* The <database> entry */
Module* us; /* Pointer to the SQL provider itself */
PGconn* sql; /* PgSQL database connection handle */
time_t idle; /* Time we last heard from the database */
public:
- SQLConn(InspIRCd* SI, Module* self, const SQLhost& hi)
- : EventHandler(), ServerInstance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
+ SQLConn(Module* self, const SQLhost& hi)
+ : EventHandler(), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
{
idle = this->ServerInstance->Time();
if(!DoConnect())
ReconnectTimer* retimer;
public:
- ModulePgSQL(InspIRCd* Me)
- : Module(Me), currid(0)
+ ModulePgSQL()
+ : currid(0)
{
ServerInstance->Modules->UseInterface("SQLutils");
bool HostInConf(const SQLhost &h)
{
- ConfigReader conf(ServerInstance);
+ ConfigReader conf;
for(int i = 0; i < conf.Enumerate("database"); i++)
{
SQLhost host;
{
ClearOldConnections();
- ConfigReader conf(ServerInstance);
+ ConfigReader conf;
for(int i = 0; i < conf.Enumerate("database"); i++)
{
SQLhost host;
SQLConn* newconn;
- newconn = new SQLConn(ServerInstance, this, hi);
+ newconn = new SQLConn(this, hi);
connections.insert(std::make_pair(hi.id, newconn));
}
break;
}
}
- retimer = new ReconnectTimer(ServerInstance, this);
+ retimer = new ReconnectTimer(this);
ServerInstance->Timers->AddTimer(retimer);
}
virtual Version GetVersion()
{
- return Version("$Id$", VF_VENDOR|VF_SERVICEPROVIDER, API_VERSION);
+ return Version("PostgreSQL Service Provider module for all other m_sql* modules, uses v2 of the SQL API", VF_VENDOR|VF_SERVICEPROVIDER, API_VERSION);
}
};