diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-02 09:41:39 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-02 09:41:39 +0000 |
commit | 001e00ba23962648cf0f8bfa1e1c50685ba6a15d (patch) | |
tree | b11fa12443541ccb218871e42863b7628af59e81 /src/commands.cpp | |
parent | 270f1f8d19779a20231a4228286da5e5bf8b2be9 (diff) |
Made threading optional
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2108 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands.cpp')
-rw-r--r-- | src/commands.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index f02c4bfcc..e47680702 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -50,7 +50,9 @@ using namespace std; #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> +#ifdef THREADED_DNS #include <pthread.h> +#endif #ifndef RUSAGE_SELF #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN -1 @@ -1724,11 +1726,17 @@ void handle_nick(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) { 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); +#endif } if (user->registered == 3) |