diff options
| author | 2007-08-19 16:00:57 +0000 | |
|---|---|---|
| committer | 2007-08-19 16:00:57 +0000 | |
| commit | df4f0dc888a2a24e7f8b42a1c21670679e633506 (patch) | |
| tree | 6fb90acdb5ad14510b53045d0f414316792466c9 /src/modules/extra/m_pgsql.cpp | |
| parent | Add load warning, as suggested by Bricker (diff) | |
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
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
| -rw-r--r-- | src/modules/extra/m_pgsql.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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) |
