diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-14 13:02:40 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-14 13:02:40 +0000 |
commit | d4ca01f12f539a7f3eda3a682b5d2fbb67fabdb7 (patch) | |
tree | 8a146cf6d517caae1d7798eda21290b4395f38de /src/cmd_nick.cpp | |
parent | 174169ac35321eedae9df6aabe7833b7df6b0279 (diff) |
Add <options:nouserdns> - 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
Diffstat (limited to 'src/cmd_nick.cpp')
-rw-r--r-- | src/cmd_nick.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
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) { |