comparison src/dnsbl.cpp @ 46:66c66a6ee65f

changes for 3.2
author carl
date Fri, 09 Jul 2004 08:16:25 -0700
parents 6b79046b18c2
children 5ef10dc14457
comparison
equal deleted inserted replaced
45:2eef08791e11 46:66c66a6ee65f
904 fprintf(stdout, "\n"); 904 fprintf(stdout, "\n");
905 } 905 }
906 if (dc.content_suffix) { 906 if (dc.content_suffix) {
907 fprintf(stdout, "\ncontent filtering enabled with %s %s\n", dc.content_suffix, dc.content_message); 907 fprintf(stdout, "\ncontent filtering enabled with %s %s\n", dc.content_suffix, dc.content_message);
908 } 908 }
909 if (dc.host_limit) { 909 if (dc.host_limit && !dc.host_random) {
910 fprintf(stdout, "\ncontent filtering for host names enabled with limit %d %s\n", dc.host_limit, dc.host_limit_message); 910 fprintf(stdout, "\ncontent filtering for host names hard limit %d %s\n", dc.host_limit, dc.host_limit_message);
911 } 911 }
912 if (dc.host_random) { 912 if (dc.host_limit && dc.host_random) {
913 fprintf(stdout, "\nrandom selection of host names, host limit message is not used\n"); 913 fprintf(stdout, "\ncontent filtering for host names soft limit %d\n", dc.host_limit);
914 } 914 }
915 if (dc.tag_limit) { 915 if (dc.tag_limit) {
916 fprintf(stdout, "\ncontent filtering for excessive html tags enabled with limit %d %s\n", dc.tag_limit, dc.tag_limit_message); 916 fprintf(stdout, "\ncontent filtering for excessive html tags enabled with limit %d %s\n", dc.tag_limit, dc.tag_limit_message);
917 } 917 }
918 fprintf(stdout, "\nfiles\n"); 918 fprintf(stdout, "\nfiles\n");
1022 my_syslog(buf); 1022 my_syslog(buf);
1023 return; 1023 return;
1024 } 1024 }
1025 dc.config_files.push_back(fn); 1025 dc.config_files.push_back(fn);
1026 map<char*, int, ltstr> commands; 1026 map<char*, int, ltstr> commands;
1027 enum {dummy, tld, content, hostlimit, hostrandom, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc}; 1027 enum {dummy, tld, content, hostlimit, hostslimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
1028 commands["tld" ] = tld; 1028 commands["tld" ] = tld;
1029 commands["content" ] = content; 1029 commands["content" ] = content;
1030 commands["host_limit" ] = hostlimit; 1030 commands["host_limit" ] = hostlimit;
1031 commands["host_random"] = hostrandom; 1031 commands["host_soft_limit"] = hostslimit;
1032 commands["html_limit" ] = htmllimit; 1032 commands["html_limit" ] = htmllimit;
1033 commands["html_tag" ] = htmltag; 1033 commands["html_tag" ] = htmltag;
1034 commands["dnsbl" ] = dnsbl; 1034 commands["dnsbl" ] = dnsbl;
1035 commands["dnsbl_list" ] = dnsbll; 1035 commands["dnsbl_list" ] = dnsbll;
1036 commands["env_from" ] = envfrom; 1036 commands["env_from" ] = envfrom;
1037 commands["env_to" ] = envto; 1037 commands["env_to" ] = envto;
1038 commands["include" ] = include; 1038 commands["include" ] = include;
1039 commands["include_dcc"] = includedcc; 1039 commands["include_dcc" ] = includedcc;
1040 const int LINE_SIZE = 2000; 1040 const int LINE_SIZE = 2000;
1041 char line[LINE_SIZE]; 1041 char line[LINE_SIZE];
1042 char orig[LINE_SIZE]; 1042 char orig[LINE_SIZE];
1043 char *delim = " \t"; 1043 char *delim = " \t";
1044 int curline = 0; 1044 int curline = 0;
1089 char *last = strchr(msg, '\''); 1089 char *last = strchr(msg, '\'');
1090 if (!last) break; // no trailing quote 1090 if (!last) break; // no trailing quote
1091 *last = '\0'; // make it a null terminator 1091 *last = '\0'; // make it a null terminator
1092 dc.host_limit = atoi(limit); 1092 dc.host_limit = atoi(limit);
1093 dc.host_limit_message = register_string(msg); 1093 dc.host_limit_message = register_string(msg);
1094 dc.host_random = false;
1094 processed = true; 1095 processed = true;
1095 } break; 1096 } break;
1096 1097
1097 case hostrandom: { 1098 case hostslimit: {
1099 char *limit = next_token(delim);
1100 if (!limit) break; // no integer limit
1101 dc.host_limit = atoi(limit);
1098 dc.host_random = true; 1102 dc.host_random = true;
1099 processed = true; 1103 processed = true;
1100 } break; 1104 } break;
1101 1105
1102 case htmllimit: { 1106 case htmllimit: {