- // 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(u);
- dnsq.push_back(L);
- return true;
+ /* First attempt to find the nickname */
+ userrec* u = Find(nick);
+ if (u)
+ {
+ /* Check the cache */
+ /*address_cache::iterator address = addrcache.find(u->ip4);
+ if (address != addrcache.end())
+ {
+ WriteServ(u->fd,"NOTICE Auth :*** Found your hostname (cached)");
+ log(DEBUG,"Found cached host");
+ strlcpy(u->host,address->second->c_str(),MAXBUF);
+ strlcpy(u->dhost,address->second->c_str(),MAXBUF);
+ u->dns_done = true;
+ return true;
+ }*/
+ /* If the user exists, create a new
+ * lookup object, and associate it
+ * with the user. The lookup object
+ * will maintain the reference table
+ * which we use for quickly finding
+ * dns results. Please note that we
+ * do not associate a lookup with a
+ * userrec* pointer and we use the
+ * nickname instead because, by the
+ * time the DNS lookup has completed,
+ * the nickname could have quit and
+ * if we then try and access the
+ * pointer we get a nice segfault.
+ */
+ Lookup* L = new Lookup();
+ L->DoLookup(nick);
+ return true;
+ }
+ return false;