From d4ca01f12f539a7f3eda3a682b5d2fbb67fabdb7 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 14 Jul 2006 13:02:40 +0000 Subject: Add - defaults to off. if set to on, no user dns lookups are performed, saving resources git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4386 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_nick.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/cmd_nick.cpp') diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index 432c2e814..3eeb37663 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -143,18 +143,24 @@ void cmd_nick::Handle (char **parameters, int pcnt, userrec *user) //if (user->dns_done) // log(DEBUG,"Aborting dns lookup of %s because dns server experienced a failure.",user->nick); -#ifdef THREADED_DNS - // initialize their dns lookup thread - if (pthread_create(&user->dnsthread, NULL, dns_task, (void *)user) != 0) + if (Config->NoUserDns) { - log(DEBUG,"Failed to create DNS lookup thread for user %s",user->nick); + user->dns_done = true; } + else + { +#ifdef THREADED_DNS + // initialize their dns lookup thread + if (pthread_create(&user->dnsthread, NULL, dns_task, (void *)user) != 0) + { + log(DEBUG,"Failed to create DNS lookup thread for user %s",user->nick); + } #else - user->dns_done = (!lookup_dns(user->nick)); - if (user->dns_done) - log(DEBUG,"Aborting dns lookup of %s because dns server experienced a failure.",user->nick); + user->dns_done = (!lookup_dns(user->nick)); + if (user->dns_done) + log(DEBUG,"Aborting dns lookup of %s because dns server experienced a failure.",user->nick); #endif - + } } if (user->registered == 3) { -- cgit v1.2.3