Rebuild for the upcoming 3.0.9 beta release.
[privoxy.git] / parsers.c
index 4617dde..0bcdc42 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.132 2008/05/21 15:47:14 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.136 2008/05/26 16:02:24 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -44,6 +44,20 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.132 2008/05/21 15:47:14 fabiankei
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.136  2008/05/26 16:02:24  fabiankeil
+ *    s@Insufficent@Insufficient@
+ *
+ *    Revision 1.135  2008/05/21 20:12:10  fabiankeil
+ *    The whole point of strclean() is to modify the
+ *    first parameter, so don't mark it immutable,
+ *    even though the compiler lets us get away with it.
+ *
+ *    Revision 1.134  2008/05/21 19:27:25  fabiankeil
+ *    As the wafer actions are gone, we can stop including encode.h.
+ *
+ *    Revision 1.133  2008/05/21 15:50:47  fabiankeil
+ *    Ditch cast from (char **) to (char **).
+ *
  *    Revision 1.132  2008/05/21 15:47:14  fabiankeil
  *    Streamline sed()'s prototype and declare
  *    the header parse and add structures static.
@@ -833,7 +847,6 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.132 2008/05/21 15:47:14 fabiankei
 #endif /* def FEATURE_PTHREAD */
 #include "list.h"
 #include "parsers.h"
-#include "encode.h"
 #include "ssplit.h"
 #include "errlog.h"
 #include "jbsockets.h"
@@ -2827,7 +2840,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header)
 
       if (*header == NULL)
       {
-         log_error(LOG_LEVEL_HEADER, "Insufficent memory. Last-Modified header got lost, boohoo.");  
+         log_error(LOG_LEVEL_HEADER, "Insufficient memory. Last-Modified header got lost, boohoo.");  
       }
       else
       {
@@ -2886,21 +2899,19 @@ static jb_err server_last_modified(struct client_state *csp, char **header)
 
             if (*header == NULL)
             {
-               log_error(LOG_LEVEL_ERROR, "Insufficent memory, header crunched without replacement.");
+               log_error(LOG_LEVEL_ERROR, "Insufficient memory, header crunched without replacement.");
                return JB_ERR_MEMORY;  
             }
 
-            if (LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
-            {
-               days    = rtime / (3600 * 24);
-               hours   = rtime / 3600 % 24;
-               minutes = rtime / 60 % 60;
-               seconds = rtime % 60;            
-
-               log_error(LOG_LEVEL_HEADER, "Randomized:  %s (added %d da%s %d hou%s %d minut%s %d second%s",
-                  *header, days, (days == 1) ? "y" : "ys", hours, (hours == 1) ? "r" : "rs",
-                  minutes, (minutes == 1) ? "e" : "es", seconds, (seconds == 1) ? ")" : "s)");
-            }
+            days    = rtime / (3600 * 24);
+            hours   = rtime / 3600 % 24;
+            minutes = rtime / 60 % 60;
+            seconds = rtime % 60;
+
+            log_error(LOG_LEVEL_HEADER,
+               "Randomized:  %s (added %d da%s %d hou%s %d minut%s %d second%s",
+               *header, days, (days == 1) ? "y" : "ys", hours, (hours == 1) ? "r" : "rs",
+               minutes, (minutes == 1) ? "e" : "es", seconds, (seconds == 1) ? ")" : "s)");
          }
          else
          {
@@ -3122,7 +3133,7 @@ static jb_err client_accept_language(struct client_state *csp, char **header)
       if (*header == NULL)
       {
          log_error(LOG_LEVEL_ERROR,
-            "Insufficent memory. Accept-Language header crunched without replacement.");  
+            "Insufficient memory. Accept-Language header crunched without replacement.");  
       }
       else
       {
@@ -3585,20 +3596,19 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header)
 
             if (*header == NULL)
             {
-               log_error(LOG_LEVEL_HEADER, "Insufficent memory, header crunched without replacement.");
+               log_error(LOG_LEVEL_HEADER, "Insufficient memory, header crunched without replacement.");
                return JB_ERR_MEMORY;  
             }
 
-            if (LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
-            {
-               hours   = rtime / 3600;
-               minutes = rtime / 60 % 60;
-               seconds = rtime % 60;            
+            hours   = rtime / 3600;
+            minutes = rtime / 60 % 60;
+            seconds = rtime % 60;
 
-               log_error(LOG_LEVEL_HEADER, "Randomized:  %s (%s %d hou%s %d minut%s %d second%s",
-                  *header, (negative) ? "subtracted" : "added", hours, (hours == 1) ? "r" : "rs",
-                  minutes, (minutes == 1) ? "e" : "es", seconds, (seconds == 1) ? ")" : "s)");
-            }
+            log_error(LOG_LEVEL_HEADER,
+               "Randomized:  %s (%s %d hou%s %d minut%s %d second%s",
+               *header, (negative) ? "subtracted" : "added", hours,
+               (hours == 1) ? "r" : "rs", minutes, (minutes == 1) ? "e" : "es",
+               seconds, (seconds == 1) ? ")" : "s)");
          }
       }
    }
@@ -4149,7 +4159,7 @@ static jb_err server_set_cookie(struct client_state *csp, char **header)
  * Returns     :  Number of eliminations
  *
  *********************************************************************/
-int strclean(const char *string, const char *substring)
+int strclean(char *string, const char *substring)
 {
    int hits = 0;
    size_t len;