Mercurial > dnsbl
comparison src/scanner.h @ 147:812c80305f26 stable-5-26
fix 5.23 bug and add fsa debug logging
author | carl |
---|---|
date | Mon, 04 Dec 2006 21:49:09 -0800 |
parents | ecb40aa3eaa5 |
children | c7fc218686f5 |
comparison
equal
deleted
inserted
replaced
146:7278c9766e26 | 147:812c80305f26 |
---|---|
17 class recorder | 17 class recorder |
18 { | 18 { |
19 mlfiPriv *priv; // needed for syslog | 19 mlfiPriv *priv; // needed for syslog |
20 string_set *html_tags; // valid tags | 20 string_set *html_tags; // valid tags |
21 string_set *tlds; // valid tlds | 21 string_set *tlds; // valid tlds |
22 string_set *cctlds; // valid cctlds | 22 string_set *cctlds; // valid cctlds |
23 string_set hosts; | 23 string_set hosts; |
24 int bad_html_tags; | 24 int bad_html_tags; |
25 int binary_tags; | 25 int binary_tags; |
26 | 26 |
27 public: | 27 public: |
29 ~recorder() { empty(); }; | 29 ~recorder() { empty(); }; |
30 void empty(); | 30 void empty(); |
31 void new_url(char *host); | 31 void new_url(char *host); |
32 void new_tag(char *tag); | 32 void new_tag(char *tag); |
33 void binary(); | 33 void binary(); |
34 void syslog(char *buf) { my_syslog(priv, buf); }; | |
34 mlfiPriv *get_priv() { return priv; }; | 35 mlfiPriv *get_priv() { return priv; }; |
35 string_set *get_cctlds() { return cctlds; }; | 36 string_set *get_cctlds() { return cctlds; }; |
36 string_set *get_tlds() { return tlds; }; | 37 string_set *get_tlds() { return tlds; }; |
37 string_set &get_hosts() { return hosts; }; | 38 string_set &get_hosts() { return hosts; }; |
38 bool excessive_bad_tags(int limit) { return (limit > 0) && (bad_html_tags > limit) && (bad_html_tags > 3*binary_tags); }; | 39 bool excessive_bad_tags(int limit) { return (limit > 0) && (bad_html_tags > limit) && (bad_html_tags > 3*binary_tags); }; |
39 bool excessive_hosts(int limit) { return (limit > 0) && (hosts.size() > limit); }; | 40 bool excessive_hosts(int limit) { return (limit > 0) && (hosts.size() > limit); }; |
41 | |
40 }; | 42 }; |
41 | 43 |
42 | 44 |
43 //////////////////////////////////////////////// | 45 //////////////////////////////////////////////// |
44 // the content scanner | 46 // the content scanner |