Mercurial > dnsbl
comparison src/dnsbl.cpp @ 36:95607fbef608
no message
author | carl |
---|---|
date | Sun, 30 May 2004 18:38:36 -0700 |
parents | d718dca81bc9 |
children | 6e9d0b2d0720 |
comparison
equal
deleted
inserted
replaced
35:d718dca81bc9 | 36:95607fbef608 |
---|---|
440 n += s; | 440 n += s; |
441 p += s; | 441 p += s; |
442 *(n++) = '.'; | 442 *(n++) = '.'; |
443 } | 443 } |
444 } | 444 } |
445 *(--n) = '\0'; // remove trailing . | 445 if (n-nam) n--; // remove trailing . |
446 *n = '\0'; // null terminate it | |
446 register_string(ns, nam); // ns host to lookup later | 447 register_string(ns, nam); // ns host to lookup later |
447 } | 448 } |
448 } | 449 } |
449 rrnum = 0; | 450 rrnum = 0; |
450 while (ns_parserr(&handle, ns_s_ar, rrnum++, &rr) == 0) { | 451 while (ns_parserr(&handle, ns_s_ar, rrnum++, &rr) == 0) { |
598 count++; | 599 count++; |
599 if ((count > lim) && (lim > 0)) { | 600 if ((count > lim) && (lim > 0)) { |
600 discard(nameservers); | 601 discard(nameservers); |
601 return reject_host; | 602 return reject_host; |
602 } | 603 } |
603 host = register_string(priv.memory->hosts, (*i).first); // put a copy into priv.memory->hosts, and return that reference | 604 host = (*i).first; // a transient reference that needs to be replaced before we return it |
604 ip = (*i).second; | 605 ip = (*i).second; |
605 if (!ip) ip = protected_dns_interface(host, false, NULL); | 606 if (!ip) ip = protected_dns_interface(host, false, NULL); |
606 if (debug_syslog) { | 607 if (debug_syslog) { |
607 char buf[200]; | 608 char buf[200]; |
608 if (ip) { | 609 if (ip) { |
617 my_syslog(buf); | 618 my_syslog(buf); |
618 } | 619 } |
619 if (ip) { | 620 if (ip) { |
620 status st = check_single(ip, dc.content_suffix); | 621 status st = check_single(ip, dc.content_suffix); |
621 if (st == reject) { | 622 if (st == reject) { |
623 host = register_string(priv.memory->hosts, host); // put a copy into priv.memory->hosts, and return that reference | |
622 discard(nameservers); | 624 discard(nameservers); |
623 return st; | 625 return st; |
624 } | 626 } |
625 } | 627 } |
626 } | 628 } |