Allow for persistent setting of simple vs. detailed statistics
[privoxy.git] / src / parsers.c
index 317d0e3..c0302b1 100644 (file)
@@ -1,7 +1,7 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.56 2002/05/12 15:34:22 jongfoster Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 2.2 2002/11/10 04:20:38 hal9 Exp $";
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/parsers.c,v $
  *
  * Purpose     :  Declares functions to parse/crunch headers and pages.
  *                Functions declared include:
@@ -40,6 +40,15 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.56 2002/05/12 15:34:22 jongfoster
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 2.2  2002/11/10 04:20:38  hal9
+ *    Fix typo: supressed -> suppressed
+ *
+ *    Revision 2.1  2002/09/11 11:23:59  oes
+ *    Fixed logging of cookies: Killed incoming cookies now logged; incoming/outgoing cookies now distinguished in log
+ *
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.56  2002/05/12 15:34:22  jongfoster
  *    Fixing typo in a comment
  *
@@ -411,6 +420,9 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.56 2002/05/12 15:34:22 jongfoster
 #include "jbsockets.h"
 #include "miscutil.h"
 #include "list.h"
+#ifdef FEATURE_ACTIVITY_CONSOLE
+#include "stats.h"
+#endif /* def FEATURE_ACTIVITY_CONSOLE */
 
 const char parsers_h_rcs[] = PARSERS_H_VERSION;
 
@@ -997,7 +1009,7 @@ jb_err client_accept_encoding(struct client_state *csp, char **header)
 {
    if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0)
    {
-      log_error(LOG_LEVEL_HEADER, "Supressed offer to compress content");
+      log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress content");
 
       freez(*header);
       if (!strcmpic(csp->http->ver, "HTTP/1.1"))
@@ -1037,7 +1049,7 @@ jb_err client_te(struct client_state *csp, char **header)
    if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0)
    {
       freez(*header);
-      log_error(LOG_LEVEL_HEADER, "Supressed offer to compress transfer");
+      log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress transfer");
    }
 
    return JB_ERR_OK;
@@ -1090,6 +1102,9 @@ jb_err client_referrer(struct client_state *csp, char **header)
       /*
        * Blocking referer
        */
+#ifdef FEATURE_ACTIVITY_CONSOLE
+      accumulate_stats(STATS_REFERER, 1);
+#endif /* def FEATURE_ACTIVITY_CONSOLE */
       log_error(LOG_LEVEL_HEADER, "crunch!");
       return JB_ERR_OK;
    }
@@ -1194,6 +1209,9 @@ jb_err client_ua(struct client_state *csp, char **header)
 {
    if ((csp->action->flags & ACTION_HIDE_USER_AGENT) != 0)
    {
+#ifdef FEATURE_ACTIVITY_CONSOLE
+      accumulate_stats(STATS_CLIENT_UA, 1);
+#endif /* def FEATURE_ACTIVITY_CONSOLE */
       log_error(LOG_LEVEL_HEADER, "crunch!");
       freez(*header);
    }
@@ -1238,6 +1256,9 @@ jb_err client_from(struct client_state *csp, char **header)
     */
    if ((newval == NULL) || (0 == strcmpic(newval, "block")) )
    {
+#ifdef FEATURE_ACTIVITY_CONSOLE
+      accumulate_stats(STATS_CLIENT_FROM, 1);
+#endif /* def FEATURE_ACTIVITY_CONSOLE */
       log_error(LOG_LEVEL_HEADER, "crunch!");
       return JB_ERR_OK;
    }
@@ -1281,7 +1302,7 @@ jb_err client_send_cookie(struct client_state *csp, char **header)
    }
    else
    {
-      log_error(LOG_LEVEL_HEADER, " crunch!");
+      log_error(LOG_LEVEL_HEADER, "Crunched outgoing cookie -- yum!");
    }
 
    /*
@@ -1329,6 +1350,9 @@ jb_err client_x_forwarded(struct client_state *csp, char **header)
    else
    {
       freez(*header);
+#ifdef FEATURE_ACTIVITY_CONSOLE
+      accumulate_stats(STATS_CLIENT_X_FORWARDED, 1);
+#endif /* def FEATURE_ACTIVITY_CONSOLE */
       log_error(LOG_LEVEL_HEADER, " crunch!");
    }
 
@@ -1675,6 +1699,7 @@ jb_err server_set_cookie(struct client_state *csp, char **header)
 
    if ((csp->action->flags & ACTION_NO_COOKIE_SET) != 0)
    {
+      log_error(LOG_LEVEL_HEADER, "Crunched incoming cookie -- yum!");
       return crumble(csp, header);
    }
    else if ((csp->action->flags & ACTION_NO_COOKIE_KEEP) != 0)