From: oes
Date: Tue, 22 May 2001 18:46:04 +0000 (+0000)
Subject: - Enabled filtering banners by size rather than URL
X-Git-Tag: v_2_9_9~510
X-Git-Url: http://www.privoxy.org/gitweb/installation.html?a=commitdiff_plain;h=1952a87fe55ceeff77c376d61e281df7aee11db7;p=privoxy.git
- Enabled filtering banners by size rather than URL
by adding patterns that replace all standard banner
sizes with the "Junkbuster" gif to the re_filterfile
- Enabled filtering WebBugs by providing a pattern
which kills all 1x1 images
- Added support for PCRE_UNGREEDY behaviour to pcrs,
which is selected by the (nonstandard and therefore
capital) letter 'U' in the option string.
It causes the quantifiers to be ungreedy by default.
Appending a ? turns back to greedy (!).
- Added a new interceptor ijb-send-banner, which
sends back the "Junkbuster" gif. Without imagelist or
MSIE detection support, or if tinygif = 1, or the
URL isn't recognized as an imageurl, a lame HTML
explanation is sent instead.
- Added new feature, which permits blocking remote
script redirects and firing back a local redirect
to the browser.
The feature is conditionally compiled, i.e. it
can be disabled with --disable-fast-redirects,
plus it must be activated by a "fast-redirects"
line in the config file, has its own log level
and of course wants to be displayed by show-proxy-args
Note: Boy, all the #ifdefs in 1001 locations and
all the fumbling with configure.in and acconfig.h
were *way* more work than the feature itself :-(
- Because a generic redirect template was needed for
this, tinygif = 3 now uses the same.
- Moved GIFs, and other static HTTP response templates
to project.h
- Some minor fixes
- Removed some >400 CRs again (Jon, you really worked
a lot! ;-)
---
diff --git a/config.h.in b/config.h.in
index 930ca660..b0217675 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,7 +3,7 @@
#define _CONFIG_H
/*********************************************************************
*
- * File : $Source: /home/administrator/cvs/ijb/acconfig.h,v $
+ * File : $Source: /cvsroot/ijbswa/current/config.h.in,v $
*
* Purpose : This file should be the first thing included in every
* .c file. (Before even system headers). It contains
@@ -37,7 +37,10 @@
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Revisions :
- * $Log: acconfig.h,v $
+ * $Log: config.h.in,v $
+ * Revision 1.1 2001/05/15 13:58:49 oes
+ * Initial revision
+ *
*
*********************************************************************/
@@ -108,6 +111,11 @@
*/
#undef FORCE_LOAD
+/*
+ * Locally redirect remote script-redirect URLs
+ */
+#undef FAST_REDIRECTS
+
/*
* Split the show-proxy-args page into a page for each config file.
*/
diff --git a/configure b/configure
index 95567ece..849b8303 100755
--- a/configure
+++ b/configure
@@ -23,6 +23,8 @@ ac_help="$ac_help
--disable-pcrs Don't support arbitrary content modification"
ac_help="$ac_help
--disable-force Don't allow blockfle to be bypassed"
+ac_help="$ac_help
+ --disable-fast-redirects Don't support fast redirects"
ac_help="$ac_help
--disable-killpopup Never block popups"
ac_help="$ac_help
@@ -588,7 +590,7 @@ EOF
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:592: checking for $ac_word" >&5
+echo "configure:594: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -618,7 +620,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:622: checking for $ac_word" >&5
+echo "configure:624: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -669,7 +671,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:673: checking for $ac_word" >&5
+echo "configure:675: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -701,7 +703,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:705: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:707: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -712,12 +714,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 716 "configure"
+#line 718 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -743,12 +745,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:747: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:749: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:752: checking whether we are using GNU C" >&5
+echo "configure:754: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -757,7 +759,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -776,7 +778,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:780: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:782: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -808,7 +810,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:812: checking how to run the C preprocessor" >&5
+echo "configure:814: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -823,13 +825,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -840,13 +842,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -857,13 +859,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -889,19 +891,19 @@ echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:893: checking for mingw32 environment" >&5
+echo "configure:895: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -918,12 +920,12 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:922: checking for Cygwin environment" >&5
+echo "configure:924: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -953,7 +955,7 @@ test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:957: checking for executable suffix" >&5
+echo "configure:959: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -963,7 +965,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -984,13 +986,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6
ac_exeext=$EXEEXT
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:988: checking for object suffix" >&5
+echo "configure:990: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1010,12 +1012,12 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1014: checking for ANSI C header files" >&5
+echo "configure:1016: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1023,7 +1025,7 @@ else
#include
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1040,7 +1042,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <
EOF
@@ -1058,7 +1060,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <
EOF
@@ -1079,7 +1081,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1090,7 +1092,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1115,12 +1117,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1119: checking for working const" >&5
+echo "configure:1121: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1190,12 +1192,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1194: checking for size_t" >&5
+echo "configure:1196: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#if STDC_HEADERS
@@ -1226,12 +1228,12 @@ fi
for ac_func in strerror bcopy memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1230: checking for $ac_func" >&5
+echo "configure:1232: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1436,6 +1438,23 @@ EOF
fi
+# Check whether --enable-fast-redirects or --disable-fast-redirects was given.
+if test "${enable_fast_redirects+set}" = set; then
+ enableval="$enable_fast_redirects"
+ if test $enableval = yes; then
+ cat >> confdefs.h <<\EOF
+#define FAST_REDIRECTS 1
+EOF
+
+fi
+else
+ cat >> confdefs.h <<\EOF
+#define FAST_REDIRECTS 1
+EOF
+
+fi
+
+
# Check whether --enable-killpopup or --disable-killpopup was given.
if test "${enable_killpopup+set}" = set; then
enableval="$enable_killpopup"
diff --git a/configure.in b/configure.in
index 808b3970..593ef0dd 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.1.1.1 2001/05/15 13:58:50 oes Exp $
+dnl $Id: configure.in,v 1.2 2001/05/20 01:21:20 jongfoster Exp $
dnl
dnl Written by and Copyright (C) 2001 the SourceForge
dnl IJBSWA team. http://ijbswa.sourceforge.net
@@ -28,6 +28,19 @@ dnl or write to the Free Software Foundation, Inc., 59
dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl
dnl $Log: configure.in,v $
+dnl Revision 1.2 2001/05/20 01:21:20 jongfoster
+dnl Version 2.9.4 checkin.
+dnl - Merged popupfile and cookiefile, and added control over PCRS
+dnl filtering, in new "permissionsfile".
+dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
+dnl file error you now get a message box (in the Win32 GUI) rather
+dnl than the program exiting with no explanation.
+dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
+dnl skipping.
+dnl - Removed tabs from "config"
+dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
+dnl - Bumped up version number.
+dnl
dnl Revision 1.1.1.1 2001/05/15 13:58:50 oes
dnl Initial import of version 2.9.3 source tree
dnl
@@ -180,6 +193,12 @@ AC_ARG_ENABLE(force,
AC_DEFINE(FORCE_LOAD)
fi],AC_DEFINE(FORCE_LOAD))
+AC_ARG_ENABLE(fast-redirects,
+[ --disable-fast-redirects Don't support fast redirects],
+[if test $enableval = yes; then
+ AC_DEFINE(FAST_REDIRECTS)
+fi], AC_DEFINE(FAST_REDIRECTS))
+
AC_ARG_ENABLE(killpopup,
[ --disable-killpopup Never block popups],
[if test $enableval = yes; then
diff --git a/errlog.c b/errlog.c
index f994118b..0aa139af 100644
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.3 2001/05/20 01:11:40 jongfoster Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.4 2001/05/21 19:32:54 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -33,6 +33,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.3 2001/05/20 01:11:40 jongfoster Ex
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.4 2001/05/21 19:32:54 jongfoster
+ * Added another #ifdef _WIN_CONSOLE
+ *
* Revision 1.3 2001/05/20 01:11:40 jongfoster
* Added support for LOG_LEVEL_FATAL
* Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE,
@@ -65,23 +68,23 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.3 2001/05/20 01:11:40 jongfoster Ex
#ifdef _WIN32
#include
-#ifndef _WIN_CONSOLE
+#ifndef _WIN_CONSOLE
#include "w32log.h"
-#endif /* ndef _WIN_CONSOLE */
+#endif /* ndef _WIN_CONSOLE */
#endif /* def _WIN32 */
#include "errlog.h"
#include "project.h"
const char errlog_h_rcs[] = ERRLOG_H_VERSION;
-
-
-/*
- * LOG_LEVEL_FATAL, LOG_LEVEL_ERROR and LOG_LEVEL_INFO
- * cannot be turned off. (There are some exceptional situations
- * where we need to get a message to the user).
- *
- * FIXME: Do we need LOG_LEVEL_INFO here?
+
+
+/*
+ * LOG_LEVEL_FATAL, LOG_LEVEL_ERROR and LOG_LEVEL_INFO
+ * cannot be turned off. (There are some exceptional situations
+ * where we need to get a message to the user).
+ *
+ * FIXME: Do we need LOG_LEVEL_INFO here?
*/
#define LOG_LEVEL_MINIMUM (LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO)
@@ -94,35 +97,35 @@ static char * logfilename = NULL;
/* logging detail level. */
static int debug = LOG_LEVEL_MINIMUM;
-static void fatal_error(const char * error_message);
-
-
-/*********************************************************************
- *
- * Function : fatal_error
- *
- * Description : Displays a fatal error to standard error (or, on
- * a WIN32 GUI, to a dialog box), and exits
- * JunkBuster with status code 1.
- *
- * Parameters :
- * 1 : error_message = The error message to display.
- *
- * Returns : Does not return.
- *
- *********************************************************************/
-static void fatal_error(const char * error_message)
-{
-#if defined(_WIN32) && !defined(_WIN_CONSOLE)
- MessageBox(NULL, error_message, "Internet JunkBuster Error",
- MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST);
-#else /* if !defined(_WIN32) || defined(_WIN_CONSOLE) */
- fputs(error_message, stderr);
-#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
-
- exit(1);
-}
-
+static void fatal_error(const char * error_message);
+
+
+/*********************************************************************
+ *
+ * Function : fatal_error
+ *
+ * Description : Displays a fatal error to standard error (or, on
+ * a WIN32 GUI, to a dialog box), and exits
+ * JunkBuster with status code 1.
+ *
+ * Parameters :
+ * 1 : error_message = The error message to display.
+ *
+ * Returns : Does not return.
+ *
+ *********************************************************************/
+static void fatal_error(const char * error_message)
+{
+#if defined(_WIN32) && !defined(_WIN_CONSOLE)
+ MessageBox(NULL, error_message, "Internet JunkBuster Error",
+ MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST);
+#else /* if !defined(_WIN32) || defined(_WIN_CONSOLE) */
+ fputs(error_message, stderr);
+#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
+
+ exit(1);
+}
+
/*********************************************************************
*
@@ -158,7 +161,7 @@ void init_error_log(const char *prog_name, const char *logfname, int debuglevel)
if( logfname )
{
if( !(fp = fopen(logfname, "a")) )
- {
+ {
log_error(LOG_LEVEL_FATAL, "init_errlog(): can't open logfile: %s", logfname);
}
@@ -212,12 +215,12 @@ void log_error(int loglevel, char *fmt, ...)
switch (loglevel)
{
- case LOG_LEVEL_ERROR:
- outc = sprintf(outbuf, "IJB(%d) Error: ", this_thread);
- break;
- case LOG_LEVEL_FATAL:
- outc = sprintf(outbuf, "IJB(%d) Fatal error: ", this_thread);
- break;
+ case LOG_LEVEL_ERROR:
+ outc = sprintf(outbuf, "IJB(%d) Error: ", this_thread);
+ break;
+ case LOG_LEVEL_FATAL:
+ outc = sprintf(outbuf, "IJB(%d) Fatal error: ", this_thread);
+ break;
case LOG_LEVEL_GPC:
outc = sprintf(outbuf, "IJB(%d) Request: ", this_thread);
break;
@@ -227,15 +230,24 @@ void log_error(int loglevel, char *fmt, ...)
case LOG_LEVEL_HEADER:
outc = sprintf(outbuf, "IJB(%d) Header: ", this_thread);
break;
- case LOG_LEVEL_INFO:
- outc = sprintf(outbuf, "IJB(%d) Info: ", this_thread);
- break;
+ case LOG_LEVEL_INFO:
+ outc = sprintf(outbuf, "IJB(%d) Info: ", this_thread);
+ break;
+#ifdef PCRS
case LOG_LEVEL_RE_FILTER:
outc = sprintf(outbuf, "IJB(%d) Re-Filter: ", this_thread);
break;
+#endif /* def PCRS */
+#ifdef FORCE_LOAD
case LOG_LEVEL_FORCE:
outc = sprintf(outbuf, "IJB(%d) Force: ", this_thread);
- break;
+ break;
+#endif /* def FORCE_LOAD */
+#ifdef FAST_REDIRECTS
+ case LOG_LEVEL_REDIRECTS:
+ outc = sprintf(outbuf, "IJB(%d) Redirect: ", this_thread);
+ break;
+#endif /* def FAST_REDIRECTS */
default:
outc = sprintf(outbuf, "IJB(%d) UNKNOWN LOG TYPE(%d): ", this_thread, loglevel);
break;
@@ -322,8 +334,8 @@ void log_error(int loglevel, char *fmt, ...)
}
fputs(outbuf, logfp);
/* FIXME RACE HAZARD: should end critical section error_log_use here */
- fatal_error(outbuf);
- /* Never get here */
+ fatal_error(outbuf);
+ /* Never get here */
break;
}
if (outc < BUFSIZ-1)
@@ -390,8 +402,8 @@ void log_error(int loglevel, char *fmt, ...)
}
fputs(outbuf, logfp);
/* FIXME RACE HAZARD: should end critical section error_log_use here */
- fatal_error(outbuf);
- /* Never get here */
+ fatal_error(outbuf);
+ /* Never get here */
break;
} /* switch( p ) */
@@ -436,14 +448,14 @@ void log_error(int loglevel, char *fmt, ...)
fputs(outbuf, logfp);
- if (loglevel == LOG_LEVEL_FATAL)
- {
- fatal_error(outbuf);
- /* Never get here */
- }
-
+ if (loglevel == LOG_LEVEL_FATAL)
+ {
+ fatal_error(outbuf);
+ /* Never get here */
+ }
+
/* FIXME RACE HAZARD: should end critical section error_log_use here */
-
+
#if defined(_WIN32) && !defined(_WIN_CONSOLE)
/* Write to display */
LogPutString(outbuf);
diff --git a/errlog.h b/errlog.h
index 82f8bc5e..22c7c810 100644
--- a/errlog.h
+++ b/errlog.h
@@ -1,6 +1,6 @@
#ifndef _ERRLOG_H
#define _ERRLOG_H
-#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.1.1.1 2001/05/15 13:58:51 oes Exp $"
+#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.2 2001/05/20 01:11:40 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.h,v $
@@ -35,6 +35,11 @@
*
* Revisions :
* $Log: errlog.h,v $
+ * Revision 1.2 2001/05/20 01:11:40 jongfoster
+ * Added support for LOG_LEVEL_FATAL
+ * Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE,
+ * and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER
+ *
* Revision 1.1.1.1 2001/05/15 13:58:51 oes
* Initial import of version 2.9.3 source tree
*
@@ -53,15 +58,20 @@ extern "C" {
#define LOG_LEVEL_IO 0x0004
#define LOG_LEVEL_HEADER 0x0008
#define LOG_LEVEL_LOG 0x0010
-#ifdef PCRS
+#ifdef FORCE_LOAD
#define LOG_LEVEL_FORCE 0x0020
+#endif /* def FORCE_LOAD */
+#ifdef PCRS
#define LOG_LEVEL_RE_FILTER 0x0040
#endif /* def PCRS */
+#ifdef FAST_REDIRECTS
+#define LOG_LEVEL_REDIRECTS 0x0080
+#endif /* def FAST_REDIRECTS */
/* Following are always on: */
#define LOG_LEVEL_INFO 0x1000
-#define LOG_LEVEL_ERROR 0x2000
-#define LOG_LEVEL_FATAL 0x4000 /* Exits after writing log */
+#define LOG_LEVEL_ERROR 0x2000
+#define LOG_LEVEL_FATAL 0x4000 /* Exits after writing log */
extern void init_error_log(const char *prog_name, const char *logfname, int debuglevel);
extern void log_error(int loglevel, char *fmt, ...);
diff --git a/filters.c b/filters.c
index f61f4fc1..42f46aff 100644
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.2 2001/05/20 01:21:20 jongfoster Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.3 2001/05/20 16:44:47 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -7,9 +7,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.2 2001/05/20 01:21:20 jongfoster
* Functions declared include:
* `acl_addr', `add_stats', `block_acl', `block_imageurl',
* `block_url', `url_permissions', `domaincmp', `dsplit',
- * `filter_popups', `forward_url',
+ * `filter_popups', `forward_url', 'redirect_url',
* `ij_untrusted_url', `intercept_url', `re_process_buffer',
- * `show_proxy_args', and `trust_url'
+ * `show_proxy_args', 'ijb_send_banner', and `trust_url'
*
* Copyright : Written by and Copyright (C) 2001 the SourceForge
* IJBSWA team. http://ijbswa.sourceforge.net
@@ -38,6 +38,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.2 2001/05/20 01:21:20 jongfoster
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.3 2001/05/20 16:44:47 jongfoster
+ * Removing last hardcoded JunkBusters.com URLs.
+ *
* Revision 1.2 2001/05/20 01:21:20 jongfoster
* Version 2.9.4 checkin.
* - Merged popupfile and cookiefile, and added control over PCRS
@@ -123,8 +126,8 @@ static const char CBLOCK[] =
"was blocked because it matches the following pattern "
"in the blockfile: %s\n
"
#ifdef FORCE_LOAD
- "Go there anyway.
"
+ "Go there anyway.
"
#endif /* def FORCE_LOAD */
"