diff src/dnsbl.cpp @ 220:495cfe5caead

try to allow mixed -lresolv and libresolv.a for ns_parserr
author Carl Byington <carl@five-ten-sg.com>
date Sun, 28 Dec 2008 00:42:03 -0800
parents 784030ac71f1
children b2a7ca398712
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sat Dec 27 23:57:24 2008 -0800
+++ b/src/dnsbl.cpp	Sun Dec 28 00:42:03 2008 -0800
@@ -532,9 +532,6 @@
             snprintf(text, sizeof(text), "process_resolver_requests() has a question %s", question);
             my_syslog(text);
         #endif
-        if ((_res.options & RES_INIT) == 0) res_init();
-        _res.retry   = 2;
-        _res.retrans = RES_TIMEOUT;
         glom.length = res_search(question, ns_c_in, ns_t_a, glom.answer, sizeof(glom.answer));
         if (glom.length < 0) glom.length = 0;   // represent all errors as zero length answers
 #else
@@ -1713,6 +1710,11 @@
                     // this is the worker process
                     // child does not need the listening socket
                     close(resolver_socket);
+#ifdef NS_PACKETSZ
+                    res_init();
+                    _res.retry   = 2;
+                    _res.retrans = RES_TIMEOUT;
+#endif
                     process_resolver_requests(s);
                     exit(0);
                 }