Now cleans up properly on FATAL (removes taskbar icon etc)
authorjongfoster <jongfoster@users.sourceforge.net>
Fri, 25 May 2001 21:55:08 +0000 (21:55 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Fri, 25 May 2001 21:55:08 +0000 (21:55 +0000)
errlog.c

index 0aa139a..4ef0e97 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.4 2001/05/21 19:32:54 jongfoster Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.5 2001/05/22 18:46:04 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -33,6 +33,50 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.4 2001/05/21 19:32:54 jongfoster Ex
  *
  * Revisions   :
  *    $Log: errlog.c,v $
  *
  * Revisions   :
  *    $Log: errlog.c,v $
+ *    Revision 1.5  2001/05/22 18:46:04  oes
+ *
+ *    - 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! ;-)
+ *
  *    Revision 1.4  2001/05/21 19:32:54  jongfoster
  *    Added another #ifdef _WIN_CONSOLE
  *
  *    Revision 1.4  2001/05/21 19:32:54  jongfoster
  *    Added another #ifdef _WIN_CONSOLE
  *
@@ -117,8 +161,12 @@ static void fatal_error(const char * error_message);
 static void fatal_error(const char * error_message)
 {
 #if defined(_WIN32) && !defined(_WIN_CONSOLE)
 static void fatal_error(const char * error_message)
 {
 #if defined(_WIN32) && !defined(_WIN_CONSOLE)
-   MessageBox(NULL, error_message, "Internet JunkBuster Error", 
+   MessageBox(g_hwndLogFrame, error_message, "Internet JunkBuster Error", 
       MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST);  
       MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST);  
+
+   /* Cleanup - remove taskbar icon etc. */
+   TermLogWindow();
+
 #else /* if !defined(_WIN32) || defined(_WIN_CONSOLE) */
    fputs(error_message, stderr);
 #endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
 #else /* if !defined(_WIN32) || defined(_WIN_CONSOLE) */
    fputs(error_message, stderr);
 #endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
@@ -207,7 +255,7 @@ void log_error(int loglevel, char *fmt, ...)
    /* verify if loglevel applies to current settings and bail out if negative */
    if(!(loglevel & debug))
    {
    /* verify if loglevel applies to current settings and bail out if negative */
    if(!(loglevel & debug))
    {
-               return;
+      return;
    }
 
    /* FIXME get current thread id */
    }
 
    /* FIXME get current thread id */
@@ -215,6 +263,7 @@ void log_error(int loglevel, char *fmt, ...)
 
    switch (loglevel)
    {
 
    switch (loglevel)
    {
+      /* FIXME: What about LOG_LEVEL_LOG ??? */
       case LOG_LEVEL_ERROR:
          outc = sprintf(outbuf, "IJB(%d) Error: ", this_thread);
          break;
       case LOG_LEVEL_ERROR:
          outc = sprintf(outbuf, "IJB(%d) Error: ", this_thread);
          break;