-SQLConn::SQLConn(ModulePgSQL* self, Server* srv, const std::string &h, unsigned int p, const std::string &d, const std::string &u, const std::string &pwd, bool s)
-: InspSocket::InspSocket(), us(self), Srv(srv), dbhost(h), dbport(p), dbname(d), dbuser(u), dbpass(pwd), ssl(s), sql(NULL), status(CWRITE), qinprog(false)
-{
- log(DEBUG, "Creating new PgSQL connection to database %s on %s:%u (%s/%s)", dbname.c_str(), dbhost.c_str(), dbport, dbuser.c_str(), dbpass.c_str());
-
- /* Some of this could be reviewed, unsure if I need to fill 'host' etc...
- * just copied this over from the InspSocket constructor.
- */
- strlcpy(this->host, dbhost.c_str(), MAXBUF);
- this->port = dbport;
-
- this->ClosePending = false;
-
- if(!inet_aton(this->host, &this->addy))
- {
- /* Its not an ip, spawn the resolver.
- * PgSQL doesn't do nonblocking DNS
- * lookups, so we do it for it.
- */
-
- log(DEBUG,"Attempting to resolve %s", this->host);
-
- this->dns.SetNS(Srv->GetConfig()->DNSServer);
- this->dns.ForwardLookupWithFD(this->host, fd);
-
- this->state = I_RESOLVING;
- socket_ref[this->fd] = this;
-
- return;
- }
- else