comparison src/dnsbl.cpp @ 39:6e9d0b2d0720

fix handling of missing include files
author carl
date Mon, 07 Jun 2004 21:07:40 -0700
parents 95607fbef608
children dc3d8d1aa2d2
comparison
equal deleted inserted replaced
38:038521f9490a 39:6e9d0b2d0720
894 //////////////////////////////////////////////// 894 ////////////////////////////////////////////////
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 dc.config_files.push_back(fn);
900 char *list = BLACK;
901 const int LINE_SIZE = 2000;
902 ifstream is(fn); 899 ifstream is(fn);
903 if (is.fail()) return; 900 if (is.fail()) return;
901 dc.config_files.push_back(fn);
902 const int LINE_SIZE = 2000;
904 char line[LINE_SIZE]; 903 char line[LINE_SIZE];
904 char *list = BLACK;
905 char *delim = " \t"; 905 char *delim = " \t";
906 int curline = 0; 906 int curline = 0;
907 while (!is.eof()) { 907 while (!is.eof()) {
908 is.getline(line, LINE_SIZE); 908 is.getline(line, LINE_SIZE);
909 curline++; 909 curline++;
957 } 957 }
958 958
959 959
960 static void load_conf(CONFIG &dc, char *fn); 960 static void load_conf(CONFIG &dc, char *fn);
961 static void load_conf(CONFIG &dc, char *fn) { 961 static void load_conf(CONFIG &dc, char *fn) {
962 ifstream is(fn);
963 if (is.fail()) return;
962 dc.config_files.push_back(fn); 964 dc.config_files.push_back(fn);
963 map<char*, int, ltstr> commands; 965 map<char*, int, ltstr> commands;
964 enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc}; 966 enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
965 commands["tld" ] = tld; 967 commands["tld" ] = tld;
966 commands["content" ] = content; 968 commands["content" ] = content;
972 commands["env_from" ] = envfrom; 974 commands["env_from" ] = envfrom;
973 commands["env_to" ] = envto; 975 commands["env_to" ] = envto;
974 commands["include" ] = include; 976 commands["include" ] = include;
975 commands["include_dcc"] = includedcc; 977 commands["include_dcc"] = includedcc;
976 const int LINE_SIZE = 2000; 978 const int LINE_SIZE = 2000;
977 ifstream is(fn);
978 if (is.fail()) return;
979 char line[LINE_SIZE]; 979 char line[LINE_SIZE];
980 char orig[LINE_SIZE]; 980 char orig[LINE_SIZE];
981 char *delim = " \t"; 981 char *delim = " \t";
982 int curline = 0; 982 int curline = 0;
983 while (!is.eof()) { 983 while (!is.eof()) {