diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_http_client.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_testcommand.cpp | 23 |
6 files changed, 12 insertions, 46 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index d72256a5f..d5041f6f7 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -1101,10 +1101,7 @@ public: { bool cached; resolver = new SQLresolver(this, ServerInstance, host, cached); - if (!cached) - ServerInstance->AddResolver(resolver); - else - delete resolver; + ServerInstance->AddResolver(resolver, cached); } catch(...) { diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 6df039dce..a5f0bca3e 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -261,10 +261,7 @@ public: { bool cached; CGIResolver* r = new CGIResolver(this, ServerInstance, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached); - if (!cached) - ServerInstance->AddResolver(r); - else - delete r; + ServerInstance->AddResolver(r, cached); } catch (ModuleException& e) { @@ -321,10 +318,7 @@ public: ServerInstance->Log(DEBUG,"MAKE RESOLVER: %s %d %s",newip, user->GetFd(), "IDENT"); bool cached; CGIResolver* r = new CGIResolver(this, ServerInstance, NotifyOpers, newip, false, user, user->GetFd(), "IDENT", cached); - if (!cached) - ServerInstance->AddResolver(r); - else - delete r; + ServerInstance->AddResolver(r, cached); } catch (ModuleException& e) { diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index d6581a7d1..a60c2eb0c 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -309,10 +309,7 @@ class ModuleDNSBL : public Module /* now we'd need to fire off lookups for `hostname'. */ bool cached; DNSBLResolver *r = new DNSBLResolver(this, ServerInstance, hostname, user, user->GetFd(), *i, cached); - if (!cached) - ServerInstance->AddResolver(r); - else - delete r; + ServerInstance->AddResolver(r, cached); } } diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp index 92a9aa348..6891aa972 100644 --- a/src/modules/m_http_client.cpp +++ b/src/modules/m_http_client.cpp @@ -151,10 +151,7 @@ bool HTTPSocket::DoRequest(HTTPClientRequest *req) { bool cached; HTTPResolver* r = new HTTPResolver(this, Server, url.domain, cached, (Module*)Mod); - if (!cached) - Instance->AddResolver(r); - else - delete r; + Instance->AddResolver(r, cached); return true; } else diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index cbecfa24f..6cc46f119 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -4124,10 +4124,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) { bool cached; SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L.IPAddr, L, cached); - if (!cached) - ServerInstance->AddResolver(sr); - else - delete sr; + ServerInstance->AddResolver(sr, cached); } catch (ModuleException& e) { @@ -4659,10 +4656,7 @@ class ModuleSpanningTree : public Module { bool cached; ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, ServerInstance,x->IPAddr, *x, cached); - if (!cached) - ServerInstance->AddResolver(snr); - else - delete snr; + ServerInstance->AddResolver(snr, cached); } catch (ModuleException& e) { diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 55632c98e..761196978 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -60,24 +60,11 @@ class cmd_woot : public command_t * do it for us as required.*/ try { - bool cached1, cached2; - MyV6Resolver* r = new MyV6Resolver(ServerInstance, Creator, "shake.stacken.kth.se", true, cached1); - if (!cached1) - ServerInstance->AddResolver(r); - else - { - ServerInstance->Log(DEBUG,"Result was cached, delete object"); - delete r; - } - - r = new MyV6Resolver(ServerInstance, Creator, "2001:6b0:1:ea:202:a5ff:fecd:13a6", false, cached2); - if (!cached2) - ServerInstance->AddResolver(r); - else - { - ServerInstance->Log(DEBUG,"Result was cached, delete object"); - delete r; - } + bool cached; + MyV6Resolver* r = new MyV6Resolver(ServerInstance, Creator, "shake.stacken.kth.se", true, cached); + ServerInstance->AddResolver(r, cached); + r = new MyV6Resolver(ServerInstance, Creator, "2001:6b0:1:ea:202:a5ff:fecd:13a6", false, cached); + ServerInstance->AddResolver(r, cached); } catch (ModuleException& e) { |