diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-05 18:01:28 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-05 18:01:28 +0000 |
commit | 5cce62f7d799f073ea6ca1793328c08c2df7c3ff (patch) | |
tree | f7c83d3655893414643f252e9c4d83cbf5327ea3 /src/dns.cpp | |
parent | c720b1b6f234b8f8145ddeda6ef48b214091136a (diff) |
Major optimizations!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@982 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index c3d7cd786..30d05e2a3 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -95,6 +95,8 @@ struct s_header { /* DNS query header */ unsigned char payload[512]; /* DNS question, populated by dns_build_query_payload() */ }; +extern time_t TIME; + void *dns_align(void *inp) { char *p = (char*)inp; int offby = ((char *)p - (char *)0) % DNS_ALIGN; @@ -161,7 +163,7 @@ void DNS::dns_init() { /* on first call only: populates servers4 struct with up i4 = 0; initdone = 1; - srand((unsigned int) time(NULL)); + srand((unsigned int) TIME); memset(servers4,'\0',sizeof(in_addr) * DNS_MAX); f = fopen(DNS_CONFIG_FBCK,"r"); if (f == NULL) @@ -191,7 +193,7 @@ void DNS::dns_init_2(const char* dnsserver) { /* populates servers4 struct with i4 = 0; initdone = 1; - srand((unsigned int) time(NULL)); + srand((unsigned int) TIME); memset(servers4,'\0',sizeof(in_addr) * DNS_MAX); if (dns_aton4_s(dnsserver,&addr4) != NULL) memcpy(&servers4[i4++],&addr4,sizeof(in_addr)); |