summaryrefslogtreecommitdiff
path: root/src/modules/m_testcommand.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 21:16:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 21:16:03 +0000
commitdac672cf303ce44dc5f877a5f9f7e5aee64b95e1 (patch)
tree3484e7870d732dd04a590640cfe5c72ea50e7dde /src/modules/m_testcommand.cpp
parent6b9eaeba4130acb818a63782640194c7e5bcc2fa (diff)
DNS Stuff - this wont work right yet, it will soon (tm)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6250 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_testcommand.cpp')
-rw-r--r--src/modules/m_testcommand.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp
index 00988ff96..55632c98e 100644
--- a/src/modules/m_testcommand.cpp
+++ b/src/modules/m_testcommand.cpp
@@ -26,7 +26,7 @@ class MyV6Resolver : public Resolver
{
bool fw;
public:
- MyV6Resolver(InspIRCd* Instance, Module* me, const std::string &source, bool forward) : Resolver(Instance, source, forward ? DNS_QUERY_AAAA : DNS_QUERY_PTR6, me)
+ MyV6Resolver(InspIRCd* Instance, Module* me, const std::string &source, bool forward, bool &cached) : Resolver(Instance, source, forward ? DNS_QUERY_AAAA : DNS_QUERY_PTR6, cached, me)
{
fw = forward;
}
@@ -60,10 +60,24 @@ class cmd_woot : public command_t
* do it for us as required.*/
try
{
- MyV6Resolver* r = new MyV6Resolver(ServerInstance, Creator, "shake.stacken.kth.se", true);
- ServerInstance->AddResolver(r);
- r = new MyV6Resolver(ServerInstance, Creator, "2001:6b0:1:ea:202:a5ff:fecd:13a6", false);
- ServerInstance->AddResolver(r);
+ 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;
+ }
}
catch (ModuleException& e)
{