From df4f0dc888a2a24e7f8b42a1c21670679e633506 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 19 Aug 2007 16:00:57 +0000 Subject: Allow support for multiple dns results per request. This is a significant change and should probably not be backported to stable. This will allow for a fix to feature request bug #384 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7753 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_pgsql.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 5d267fc1a..393cbd1d7 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -107,7 +107,7 @@ class SQLresolver : public Resolver { } - virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached); + virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0); virtual void OnError(ResolverError e, const std::string &errormessage) { @@ -963,11 +963,14 @@ class ModulePgSQL : public Module /* move this here to use AddConn, rather that than having the whole * module above SQLConn, since this is buggin me right now :/ */ -void SQLresolver::OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) +void SQLresolver::OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum) { - host.ip = result; - ((ModulePgSQL*)mod)->AddConn(host); - ((ModulePgSQL*)mod)->ClearOldConnections(); + if (!resultnum) + { + host.ip = result; + ((ModulePgSQL*)mod)->AddConn(host); + ((ModulePgSQL*)mod)->ClearOldConnections(); + } } void ReconnectTimer::Tick(time_t time) -- cgit v1.2.3