-/* This function is a thread function which can be thought of as a lightweight process
- * to all you non-threaded people. In actuality its so much more, and pretty damn cool.
- * With threaded dns enabled, each user which connects gets a thread attached to their
- * user record when their DNS lookup starts. This function starts in parallel, and
- * commences a blocking dns lookup. Because its a seperate thread, this occurs without
- * actually blocking the main application. Once the dns lookup is completed, the thread
- * checks if the user is still around by checking their fd against the reference table,
- * and if they are, writes the hostname into the struct and terminates, after setting
- * userrec::dns_done to true. Because this is multi-threaded it can make proper use of
- * SMP setups (like the one i have here *grin*).
- * This is in comparison to the non-threaded dns, which must monitor the thread sockets
- * in a nonblocking fashion, consuming more resources to do so.
- *
- * NB: Yes this does scale, thank you. Even with large numbers of connecting clients
- * in any one timeframe, they wont all connect *at the same time* therefore any argument
- * of "but there will be thousands of threads it'll blow up" is moot, ive tested this and
- * there will only ever be somewhere around the listen backlog in number of pending
- * lookups at any one time. This is significant on any modern SMP system.
- */
-void* dns_task(void* arg)
-{
- userrec* u = (userrec*)arg;
- int thisfd = u->fd;
-
- log(DEBUG,"DNS thread for user %s",u->nick);
- DNS dns1(Config->DNSServer);
- DNS dns2(Config->DNSServer);
- std::string host;
- std::string ip;
- int iterations = 0;
-
- if (dns1.ReverseLookup(inet_ntoa(u->ip4),false))