X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=d56fde8bf1636f6da292016b1407934a6088712c;hb=e8bde4a89b3b85515513257ab6944fcfb683252c;hp=92d1567f9985dfa00663d1a8f48b79ca96efbce4;hpb=8ea88830572f89a45b806170be4defe6e102bcee;p=privoxy.git diff --git a/parsers.c b/parsers.c index 92d1567f..d56fde8b 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.71 2006/09/21 19:55:17 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.74 2006/10/02 16:59:12 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -40,6 +40,18 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.71 2006/09/21 19:55:17 fabiankeil * * Revisions : * $Log: parsers.c,v $ + * Revision 1.74 2006/10/02 16:59:12 fabiankeil + * The special header "X-Filter: No" now disables + * header filtering as well. + * + * 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}. * @@ -527,11 +539,10 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.71 2006/09/21 19:55:17 fabiankeil #include "project.h" -#ifdef OSX_DARWIN -#include +#ifdef FEATURE_PTHREAD #include "jcc.h" /* jcc.h is for mutex semapores only */ -#endif /* def OSX_DARWIN */ +#endif /* def FEATURE_PTHREAD */ #include "list.h" #include "parsers.h" #include "encode.h" @@ -1113,7 +1124,7 @@ jb_err filter_header(struct client_state *csp, char **header) 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); } @@ -1568,7 +1579,7 @@ jb_err server_last_modified(struct client_state *csp, char **header) now = time(NULL); #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&now, &gmt); -#elif OSX_DARWIN +#elif FEATURE_PTHREAD pthread_mutex_lock(&gmtime_mutex); timeptr = gmtime(&now); pthread_mutex_unlock(&gmtime_mutex); @@ -1589,7 +1600,7 @@ jb_err server_last_modified(struct client_state *csp, char **header) last_modified += rtime; #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&last_modified, &gmt); -#elif OSX_DARWIN +#elif FEATURE_PTHREAD pthread_mutex_lock(&gmtime_mutex); timeptr = gmtime(&last_modified); pthread_mutex_unlock(&gmtime_mutex); @@ -2338,7 +2349,7 @@ jb_err client_if_modified_since(struct client_state *csp, char **header) tm += rtime * (negative ? -1 : 1); #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&tm, &gmt); -#elif OSX_DARWIN +#elif FEATURE_PTHREAD pthread_mutex_lock(&gmtime_mutex); timeptr = gmtime(&tm); pthread_mutex_unlock(&gmtime_mutex); @@ -2427,7 +2438,7 @@ jb_err client_x_filter(struct client_state *csp, char **header) { log_error(LOG_LEVEL_INFO, "Ignored the client's request to fetch without filtering."); } - else + else { if (csp->action->flags & ACTION_FORCE_TEXT_MODE) { @@ -2436,6 +2447,8 @@ jb_err client_x_filter(struct client_state *csp, char **header) 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); @@ -2765,7 +2778,7 @@ jb_err server_set_cookie(struct client_state *csp, char **header) time (&now); #ifdef HAVE_LOCALTIME_R tm_now = *localtime_r(&now, &tm_now); -#elif OSX_DARWIN +#elif FEATURE_PTHREAD pthread_mutex_lock(&localtime_mutex); tm_now = *localtime (&now); pthread_mutex_unlock(&localtime_mutex);