comparison src/dnsbl.cpp @ 40:dc3d8d1aa2d2

fix handling of missing include files
author carl
date Mon, 07 Jun 2004 21:07:40 -0700
parents 6e9d0b2d0720
children d95af8129dfa
comparison
equal deleted inserted replaced
39:6e9d0b2d0720 40:dc3d8d1aa2d2
895 // load a single config file 895 // load a single config file
896 // 896 //
897 static void load_conf_dcc(CONFIG &dc, char *name, char *fn); 897 static void load_conf_dcc(CONFIG &dc, char *name, char *fn);
898 static void load_conf_dcc(CONFIG &dc, char *name, char *fn) { 898 static void load_conf_dcc(CONFIG &dc, char *name, char *fn) {
899 ifstream is(fn); 899 ifstream is(fn);
900 if (is.fail()) return; 900 if (is.fail()) {
901 char buf[1000];
902 snprintf(buf, sizeof(buf), "include file %s not found", fn);
903 my_syslog(buf);
904 return;
905 }
901 dc.config_files.push_back(fn); 906 dc.config_files.push_back(fn);
902 const int LINE_SIZE = 2000; 907 const int LINE_SIZE = 2000;
903 char line[LINE_SIZE]; 908 char line[LINE_SIZE];
904 char *list = BLACK; 909 char *list = BLACK;
905 char *delim = " \t"; 910 char *delim = " \t";
958 963
959 964
960 static void load_conf(CONFIG &dc, char *fn); 965 static void load_conf(CONFIG &dc, char *fn);
961 static void load_conf(CONFIG &dc, char *fn) { 966 static void load_conf(CONFIG &dc, char *fn) {
962 ifstream is(fn); 967 ifstream is(fn);
963 if (is.fail()) return; 968 if (is.fail()) {
969 char buf[1000];
970 snprintf(buf, sizeof(buf), "include file %s not found", fn);
971 my_syslog(buf);
972 return;
973 }
964 dc.config_files.push_back(fn); 974 dc.config_files.push_back(fn);
965 map<char*, int, ltstr> commands; 975 map<char*, int, ltstr> commands;
966 enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc}; 976 enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
967 commands["tld" ] = tld; 977 commands["tld" ] = tld;
968 commands["content" ] = content; 978 commands["content" ] = content;