diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-03 16:00:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-03 16:00:55 +0000 |
commit | 9e0fd68e34beeb5b6234fdbe2b70351bf781debe (patch) | |
tree | e5545afbb8d658bf9e35df4ba89ba631cebbe54f | |
parent | c5b44768744d758e8f66679bada353039a206b16 (diff) |
Fixed resolver, forward lookup of ipv6 doesnt work right yet
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4674 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/users.h | 1 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_testcommand.cpp | 6 | ||||
-rw-r--r-- | src/users.cpp | 3 |
5 files changed, 9 insertions, 7 deletions
diff --git a/include/users.h b/include/users.h index 71a0763da..13dc33709 100644 --- a/include/users.h +++ b/include/users.h @@ -75,6 +75,7 @@ class UserResolver : public Resolver */ userrec* bound_user; int bound_fd; + bool fwd; public: UserResolver(userrec* user, std::string to_resolve, bool forward); diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index f81b97fed..a063a0849 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -56,7 +56,7 @@ class CGIResolver : public Resolver bool notify; public: CGIResolver(bool NotifyOpers, const std::string &source, bool forward, userrec* u, int userfd, const std::string &type) - : Resolver(source, forward), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { } + : Resolver(source, forward ? DNS_QUERY_FORWARD : DNS_QUERY_REVERSE), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { } virtual void OnLookupComplete(const std::string &result) { diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 76de8af3a..f64f24013 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3063,7 +3063,7 @@ class ServernameResolver : public Resolver */ Link MyLink; public: - ServernameResolver(const std::string &hostname, Link x) : Resolver(hostname, true), MyLink(x) + ServernameResolver(const std::string &hostname, Link x) : Resolver(hostname, DNS_QUERY_FORWARD), MyLink(x) { /* Nothing in here, folks */ } @@ -3104,7 +3104,7 @@ class SecurityIPResolver : public Resolver private: Link MyLink; public: - SecurityIPResolver(const std::string &hostname, Link x) : Resolver(hostname, true), MyLink(x) + SecurityIPResolver(const std::string &hostname, Link x) : Resolver(hostname, DNS_QUERY_FORWARD), MyLink(x) { } diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index fb061a898..ebb09a19d 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -25,10 +25,10 @@ using namespace std; /* $ModDesc: Povides a proof-of-concept test /WOOT command */ -class MyResolver : public Resolver +class MyV6Resolver : public Resolver { public: - MyResolver(const std::string &source, bool forward) : Resolver(source, forward) { } + MyV6Resolver(const std::string &source) : Resolver(source, DNS_QUERY_AAAA) { } virtual void OnLookupComplete(const std::string &result) { @@ -58,7 +58,7 @@ class cmd_woot : public command_t try { - MyResolver* r = new MyResolver("brainbox.ath.cx", true); + MyV6Resolver* r = new MyV6Resolver("shake.stacken.kth.se"); Srv->AddResolver(r); } catch (ModuleException& e) diff --git a/src/users.cpp b/src/users.cpp index ced542d3c..661dc905b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -148,8 +148,9 @@ void userrec::StartDNSLookup() } } -UserResolver::UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user) +UserResolver::UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward ? DNS_QUERY_FORWARD : DNS_QUERY_REVERSE), bound_user(user) { + this->fwd = forward; this->bound_fd = user->fd; } |