changeset 40:dc3d8d1aa2d2

fix handling of missing include files
author carl
date Mon, 07 Jun 2004 21:07:40 -0700
parents 6e9d0b2d0720
children d95af8129dfa
files src/dnsbl.cpp src/package
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dnsbl.cpp	Mon Jun 07 21:07:40 2004 -0700
+++ b/src/dnsbl.cpp	Mon Jun 07 21:07:40 2004 -0700
@@ -897,7 +897,12 @@
 static void load_conf_dcc(CONFIG &dc, char *name, char *fn);
 static void load_conf_dcc(CONFIG &dc, char *name, char *fn) {
     ifstream is(fn);
-    if (is.fail()) return;
+    if (is.fail()) {
+        char buf[1000];
+        snprintf(buf, sizeof(buf), "include file %s not found", fn);
+        my_syslog(buf);
+        return;
+    }
     dc.config_files.push_back(fn);
     const int LINE_SIZE = 2000;
     char line[LINE_SIZE];
@@ -960,7 +965,12 @@
 static void load_conf(CONFIG &dc, char *fn);
 static void load_conf(CONFIG &dc, char *fn) {
     ifstream is(fn);
-    if (is.fail()) return;
+    if (is.fail()) {
+        char buf[1000];
+        snprintf(buf, sizeof(buf), "include file %s not found", fn);
+        my_syslog(buf);
+        return;
+    }
     dc.config_files.push_back(fn);
     map<char*, int, ltstr> commands;
     enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
--- a/src/package	Mon Jun 07 21:07:40 2004 -0700
+++ b/src/package	Mon Jun 07 21:07:40 2004 -0700
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VER=dnsbl-3.0
+VER=dnsbl-3.1
 mkdir $VER
     target1=/home/httpd/html/510sg/util/dnsbl.tar.gz
     target2=/home/httpd/html/510sg/dnsbl.conf