Give crunched requests their own log level.
authorFabian Keil <fk@fabiankeil.de>
Sun, 14 Dec 2008 15:46:23 +0000 (15:46 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 14 Dec 2008 15:46:23 +0000 (15:46 +0000)
config
doc/source/p-config.sgml
errlog.c
errlog.h
jcc.c

diff --git a/config b/config
index ffa50bd..5f71d4a 100644 (file)
--- a/config
+++ b/config
@@ -1,6 +1,6 @@
 #        Sample Configuration File for Privoxy v3.0.11
 #
 #        Sample Configuration File for Privoxy v3.0.11
 #
-#  $Id: config,v 1.67 2008/08/30 15:31:53 fabiankeil Exp $
+#  $Id: config,v 1.68 2008/12/13 18:19:44 fabiankeil Exp $
 #
 #  Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
 #
 #
 #  Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
 #
@@ -557,7 +557,7 @@ logfile logfile
 #
 #      The available debug levels are:
 #
 #
 #      The available debug levels are:
 #
-#        debug         1 # log each request destination (and the crunch reason if Privoxy intercepted the request)
+#        debug         1 # Log the destination for each request Privoxy let through. See also debug 1024.
 #        debug         2 # show each connection status
 #        debug         4 # show I/O status
 #        debug         8 # show header parsing
 #        debug         2 # show each connection status
 #        debug         4 # show I/O status
 #        debug         8 # show header parsing
@@ -567,7 +567,7 @@ logfile logfile
 #        debug       128 # debug redirects
 #        debug       256 # debug GIF de-animation
 #        debug       512 # Common Log Format
 #        debug       128 # debug redirects
 #        debug       256 # debug GIF de-animation
 #        debug       512 # Common Log Format
-#        debug      1024 # Unused
+#        debug      1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
 #        debug      2048 # CGI user interface
 #        debug      4096 # Startup banner and warnings.
 #        debug      8192 # Non-fatal errors
 #        debug      2048 # CGI user interface
 #        debug      4096 # Startup banner and warnings.
 #        debug      8192 # Non-fatal errors
@@ -601,7 +601,8 @@ logfile logfile
 #      you read the log messages, you may even be able to solve the
 #      problem on your own.
 #
 #      you read the log messages, you may even be able to solve the
 #      problem on your own.
 #
-#debug      1 # log each request destination (and the crunch reason if Privoxy intercepted the request)
+#debug      1 # Log the destination for each request Privoxy let through.
+#debug   1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
 #debug   4096 # Startup banner and warnings
 #debug   8192 # Non-fatal errors
 #
 #debug   4096 # Startup banner and warnings
 #debug   8192 # Non-fatal errors
 #
index b1079f9..c62e034 100644 (file)
@@ -3,7 +3,7 @@
 
  Purpose     :  Used with other docs and files only.
 
 
  Purpose     :  Used with other docs and files only.
 
- $Id: p-config.sgml,v 2.32 2008/08/30 12:03:09 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.33 2008/12/13 10:48:21 fabiankeil Exp $
 
  Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
  See LICENSE.
 
  Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
  See LICENSE.
@@ -95,7 +95,7 @@
  Sample Configuration File for Privoxy v&p-version;
 </title>
 <para>
  Sample Configuration File for Privoxy v&p-version;
 </title>
 <para>
- $Id: p-config.sgml,v 2.32 2008/08/30 12:03:09 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.33 2008/12/13 10:48:21 fabiankeil Exp $
 </para>
 <para>
 Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
 </para>
 <para>
 Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/
@@ -1004,7 +1004,7 @@ actionsfile
    </para>
    <para>
     <programlisting>
    </para>
    <para>
     <programlisting>
-  debug     1 # log each request destination (and the crunch reason if &my-app; intercepted the request)
+  debug     1 # Log the destination for each request &my-app; let through. See also debug 1024.
   debug     2 # show each connection status
   debug     4 # show I/O status
   debug     8 # show header parsing
   debug     2 # show each connection status
   debug     4 # show I/O status
   debug     8 # show header parsing
@@ -1014,6 +1014,7 @@ actionsfile
   debug   128 # debug redirects
   debug   256 # debug GIF de-animation
   debug   512 # Common Log Format
   debug   128 # debug redirects
   debug   256 # debug GIF de-animation
   debug   512 # Common Log Format
+  debug  1024 # Log the destination for requests &my-app; didn't let through, and the reason why.
   debug  2048 # CGI user interface
   debug  4096 # Startup banner and warnings.
   debug  8192 # Non-fatal errors
   debug  2048 # CGI user interface
   debug  4096 # Startup banner and warnings.
   debug  8192 # Non-fatal errors
@@ -1058,7 +1059,8 @@ actionsfile
  </varlistentry>
 </variablelist>
 
  </varlistentry>
 </variablelist>
 
-<![%config-file;[<literallayout>@@#debug     1 # log each request destination (and the crunch reason if &my-app; intercepted the request)</literallayout>]]>
+<![%config-file;[<literallayout>@@#debug     1 # Log the destination for each request &my-app; let through.</literallayout>]]>
+<![%config-file;[<literallayout>@@#debug  1024 # Log the destination for requests &my-app; didn't let through, and the reason why.</literallayout>]]>
 <![%config-file;[<literallayout>@@#debug  4096 # Startup banner and warnings</literallayout>]]>
 <![%config-file;[<literallayout>@@#debug  8192 # Non-fatal errors</literallayout>]]>
 </sect3>
 <![%config-file;[<literallayout>@@#debug  4096 # Startup banner and warnings</literallayout>]]>
 <![%config-file;[<literallayout>@@#debug  8192 # Non-fatal errors</literallayout>]]>
 </sect3>
index c69b8d7..22f5ae4 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.82 2008/11/23 16:06:58 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.83 2008/12/04 18:14:32 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -33,6 +33,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.82 2008/11/23 16:06:58 fabiankeil E
  *
  * Revisions   :
  *    $Log: errlog.c,v $
  *
  * Revisions   :
  *    $Log: errlog.c,v $
+ *    Revision 1.83  2008/12/04 18:14:32  fabiankeil
+ *    Fix some cparser warnings.
+ *
  *    Revision 1.82  2008/11/23 16:06:58  fabiankeil
  *    Update a log message I missed in 1.80.
  *
  *    Revision 1.82  2008/11/23 16:06:58  fabiankeil
  *    Update a log message I missed in 1.80.
  *
@@ -952,6 +955,9 @@ static inline const char *get_log_level_string(int loglevel)
       case LOG_LEVEL_DEANIMATE:
          log_level_string = "Gif-Deanimate";
          break;
       case LOG_LEVEL_DEANIMATE:
          log_level_string = "Gif-Deanimate";
          break;
+      case LOG_LEVEL_CRUNCH:
+         log_level_string = "Crunch";
+         break;
       case LOG_LEVEL_CGI:
          log_level_string = "CGI";
          break;
       case LOG_LEVEL_CGI:
          log_level_string = "CGI";
          break;
@@ -1002,7 +1008,7 @@ void log_error(int loglevel, const char *fmt, ...)
     * the taskbar icon animate.  (There is an option to disable
     * this but checking that is handled inside LogShowActivity()).
     */
     * the taskbar icon animate.  (There is an option to disable
     * this but checking that is handled inside LogShowActivity()).
     */
-   if (loglevel == LOG_LEVEL_GPC)
+   if ((loglevel == LOG_LEVEL_GPC) || (loglevel == LOG_LEVEL_CRUNCH))
    {
       LogShowActivity();
    }
    {
       LogShowActivity();
    }
index ee08d53..950f52d 100644 (file)
--- a/errlog.h
+++ b/errlog.h
@@ -1,6 +1,6 @@
 #ifndef ERRLOG_H_INCLUDED
 #define ERRLOG_H_INCLUDED
 #ifndef ERRLOG_H_INCLUDED
 #define ERRLOG_H_INCLUDED
-#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.19 2007/10/14 14:12:41 fabiankeil Exp $"
+#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.20 2008/03/27 18:27:23 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.h,v $
@@ -35,6 +35,9 @@
  *
  * Revisions   :
  *    $Log: errlog.h,v $
  *
  * Revisions   :
  *    $Log: errlog.h,v $
+ *    Revision 1.20  2008/03/27 18:27:23  fabiankeil
+ *    Remove kill-popups action.
+ *
  *    Revision 1.19  2007/10/14 14:12:41  fabiankeil
  *    When in daemon mode, close stderr after the configuration file has been
  *    parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436.
  *    Revision 1.19  2007/10/14 14:12:41  fabiankeil
  *    When in daemon mode, close stderr after the configuration file has been
  *    parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436.
@@ -157,6 +160,7 @@ extern "C" {
 
 /* Debug level for errors */
 
 
 /* Debug level for errors */
 
+/* XXX: Should be renamed. */
 #define LOG_LEVEL_GPC        0x0001
 #define LOG_LEVEL_CONNECT    0x0002
 #define LOG_LEVEL_IO         0x0004
 #define LOG_LEVEL_GPC        0x0001
 #define LOG_LEVEL_CONNECT    0x0002
 #define LOG_LEVEL_IO         0x0004
@@ -169,6 +173,7 @@ extern "C" {
 #define LOG_LEVEL_REDIRECTS  0x0080
 #define LOG_LEVEL_DEANIMATE  0x0100
 #define LOG_LEVEL_CLF        0x0200 /* Common Log File format */
 #define LOG_LEVEL_REDIRECTS  0x0080
 #define LOG_LEVEL_DEANIMATE  0x0100
 #define LOG_LEVEL_CLF        0x0200 /* Common Log File format */
+#define LOG_LEVEL_CRUNCH     0x0400
 #define LOG_LEVEL_CGI        0x0800 /* CGI / templates */
 
 /* Following are always on: */
 #define LOG_LEVEL_CGI        0x0800 /* CGI / templates */
 
 /* Following are always on: */
diff --git a/jcc.c b/jcc.c
index d6bbf85..2423c28 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.210 2008/12/02 22:03:18 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.211 2008/12/06 10:05:03 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.210 2008/12/02 22:03:18 fabiankeil Exp $"
  *
  * Revisions   :
  *    $Log: jcc.c,v $
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.211  2008/12/06 10:05:03  fabiankeil
+ *    Downgrade "Received x bytes while expecting y." message to
+ *    LOG_LEVEL_CONNECT as it doesn't necessarily indicate an error.
+ *
  *    Revision 1.210  2008/12/02 22:03:18  fabiankeil
  *    Don't miscalculate byte_count if we don't get all the
  *    server headers with one read_socket() call. With keep-alive
  *    Revision 1.210  2008/12/02 22:03:18  fabiankeil
  *    Don't miscalculate byte_count if we don't get all the
  *    server headers with one read_socket() call. With keep-alive
@@ -1817,8 +1821,8 @@ static void send_crunch_response(const struct client_state *csp, struct http_res
       }
 
       /* Log that the request was crunched and why. */
       }
 
       /* Log that the request was crunched and why. */
-      log_error(LOG_LEVEL_GPC, "%s%s crunch! (%s)",
-         http->hostport, http->path, crunch_reason(rsp));
+      log_error(LOG_LEVEL_CRUNCH, "%s: %s%s",
+         crunch_reason(rsp), http->hostport, http->path);
       log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %d",
          csp->ip_addr_str, http->ocmd, status_code, rsp->content_length);
 
       log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %d",
          csp->ip_addr_str, http->ocmd, status_code, rsp->content_length);