comparison 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
comparison
equal deleted inserted replaced
219:45b298212ff1 220:495cfe5caead
530 #ifdef RESOLVER_DEBUG 530 #ifdef RESOLVER_DEBUG
531 char text[1000]; 531 char text[1000];
532 snprintf(text, sizeof(text), "process_resolver_requests() has a question %s", question); 532 snprintf(text, sizeof(text), "process_resolver_requests() has a question %s", question);
533 my_syslog(text); 533 my_syslog(text);
534 #endif 534 #endif
535 if ((_res.options & RES_INIT) == 0) res_init();
536 _res.retry = 2;
537 _res.retrans = RES_TIMEOUT;
538 glom.length = res_search(question, ns_c_in, ns_t_a, glom.answer, sizeof(glom.answer)); 535 glom.length = res_search(question, ns_c_in, ns_t_a, glom.answer, sizeof(glom.answer));
539 if (glom.length < 0) glom.length = 0; // represent all errors as zero length answers 536 if (glom.length < 0) glom.length = 0; // represent all errors as zero length answers
540 #else 537 #else
541 glom.length = sizeof(glom.answer); 538 glom.length = sizeof(glom.answer);
542 glom.answer = 0; 539 glom.answer = 0;
1711 int newchild = fork(); 1708 int newchild = fork();
1712 if (newchild == 0) { 1709 if (newchild == 0) {
1713 // this is the worker process 1710 // this is the worker process
1714 // child does not need the listening socket 1711 // child does not need the listening socket
1715 close(resolver_socket); 1712 close(resolver_socket);
1713 #ifdef NS_PACKETSZ
1714 res_init();
1715 _res.retry = 2;
1716 _res.retrans = RES_TIMEOUT;
1717 #endif
1716 process_resolver_requests(s); 1718 process_resolver_requests(s);
1717 exit(0); 1719 exit(0);
1718 } 1720 }
1719 else { 1721 else {
1720 // this is the parent 1722 // this is the parent