-const char parsers_rcs[] = "$Id: parsers.c,v 1.68 2006/09/06 10:43:32 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.73 2006/09/23 13:26:38 roro Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.73 2006/09/23 13:26:38 roro
+ * Replace TABs by spaces in source code.
+ *
+ * Revision 1.72 2006/09/23 12:37:21 fabiankeil
+ * Don't print a log message every time filter_headers is
+ * entered or left. It only creates noise without any real
+ * information.
+ *
+ * Revision 1.71 2006/09/21 19:55:17 fabiankeil
+ * Fix +hide-if-modified-since{-n}.
+ *
+ * Revision 1.70 2006/09/08 12:06:34 fabiankeil
+ * Have hide-if-modified-since interpret the random
+ * range value as minutes instead of hours. Allows
+ * more fine-grained configuration.
+ *
+ * Revision 1.69 2006/09/06 16:25:51 fabiankeil
+ * Always have parse_header_time return a pointer
+ * that actual makes sense, even though we currently
+ * only need it to detect problems.
+ *
* Revision 1.68 2006/09/06 10:43:32 fabiankeil
* Added config option enable-remote-http-toggle
* to specify if Privoxy should recognize special
int i, found_filters = 0;
- log_error(LOG_LEVEL_RE_FILTER, "Entered filter_headers");
/*
* Need to check the set of re_filterfiles...
*/
if ( 0 == size )
{
- log_error(LOG_LEVEL_HEADER, "Removing empty header %s", *header);
+ log_error(LOG_LEVEL_HEADER, "Removing empty header %s", *header);
freez(*header);
}
- log_error(LOG_LEVEL_RE_FILTER, "Leaving filter headers");
- return(JB_ERR_OK);
+ return(JB_ERR_OK);
}
else
{
rtime = strtol(newval, &endptr, 0);
- if(rtime < 0)
- {
- rtime *= -1;
- negative = 1;
- }
if(rtime)
{
- log_error(LOG_LEVEL_HEADER, "Randomizing: %s (random range: %d hou%s)",
- *header, rtime, (rtime == 1 || rtime == -1) ? "r": "rs");
- rtime *= 3600;
+ log_error(LOG_LEVEL_HEADER, "Randomizing: %s (random range: %d minut%s)",
+ *header, rtime, (rtime == 1 || rtime == -1) ? "e": "es");
+ if(rtime < 0)
+ {
+ rtime *= -1;
+ negative = 1;
+ }
+ rtime *= 60;
rtime = pick_from_range(rtime);
}
else
log_error(LOG_LEVEL_ERROR, "Random range is 0. Assuming time transformation test.",
*header);
}
- tm += rtime;
+ tm += rtime * (negative ? -1 : 1);
#ifdef HAVE_GMTIME_R
timeptr = gmtime_r(&tm, &gmt);
#elif OSX_DARWIN
{
log_error(LOG_LEVEL_INFO, "Ignored the client's request to fetch without filtering.");
}
- else
+ else
{
if (csp->action->flags & ACTION_FORCE_TEXT_MODE)
{
else
{
csp->content_type = CT_TABOO;
+ csp->action->flags &= ~ACTION_FILTER_SERVER_HEADERS;
+ csp->action->flags &= ~ACTION_FILTER_CLIENT_HEADERS;
log_error(LOG_LEVEL_HEADER, "Accepted the client's request to fetch without filtering.");
}
log_error(LOG_LEVEL_HEADER, "Crunching %s", *header);