diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-02 21:04:15 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-02 21:04:15 +0000 |
commit | e0e0338b6b7cee98540bb28a7f1c90e84bb0c5db (patch) | |
tree | dc6768a284b0d8ab0402ab5883a06b1b293c73a2 /src/dnsqueue.cpp | |
parent | 7af42fd63e09131bbd24636f4c6d631049427d2c (diff) |
Fixes for dns queueing, timeout functions etc moved to more sensible place
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@956 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dnsqueue.cpp')
-rw-r--r-- | src/dnsqueue.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/dnsqueue.cpp b/src/dnsqueue.cpp index 043ee8d4f..71ab99019 100644 --- a/src/dnsqueue.cpp +++ b/src/dnsqueue.cpp @@ -188,16 +188,19 @@ public: delete resolver; } - Lookup(std::string nick) + bool DoLookup(std::string nick) { userrec* usr = Find(nick); if (usr) { log(DEBUG,"New Lookup class for %s with DNSServer set to '%s'",nick.c_str(),DNSServer); resolver = new DNS(std::string(DNSServer)); - resolver->ReverseLookup(std::string(usr->host)); + if (!resolver->ReverseLookup(std::string(usr->host))) + return false; strlcpy(u,nick.c_str(),NICKMAX); + return true; } + return false; } bool Done() @@ -257,15 +260,22 @@ bool lookup_dns(std::string nick) // place a new user into the queue... log(DEBUG,"Queueing DNS lookup for %s",u->nick); WriteServ(u->fd,"NOTICE Auth :Looking up your hostname..."); - Lookup L(nick); - for (int j = 0; j < MAXBUF; j++) + Lookup L; + if (L.DoLookup(nick)) { - if (!dnsq[j].GetFD()) + for (int j = 0; j < MAXBUF; j++) { - dnsq[j] = L; - return true; + if (!dnsq[j].GetFD()) + { + dnsq[j] = L; + return true; + } } } + else + { + return false; + } } return false; } |