X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=loaders.c;h=a9820df58b01e5b8e55eb857cac9ae67d9cfc267;hp=20f0888d3fa343c160d1d2dc8be122468a4588af;hb=c74183d1e272e806975969ffaef1e0abb442d7ef;hpb=474da767dab3b253752a6bdfb0f39e7e11c994b0 diff --git a/loaders.c b/loaders.c index 20f0888d..a9820df5 100644 --- a/loaders.c +++ b/loaders.c @@ -46,7 +46,7 @@ #include #include -#if !defined(_WIN32) && !defined(__OS2__) +#if !defined(_WIN32) #include #endif @@ -222,13 +222,13 @@ unsigned int sweep(void) { last_active->next = client_list->next; -#ifdef FEATURE_STATISTICS +#if defined(FEATURE_STATISTICS) && !defined(MUTEX_LOCKS_AVAILABLE) urls_read++; if (csp->flags & CSP_FLAG_REJECTED) { urls_rejected++; } -#endif /* def FEATURE_STATISTICS */ +#endif /* defined(FEATURE_STATISTICS) && !defined(MUTEX_LOCKS_AVAILABLE) */ freez(client_list); @@ -1164,6 +1164,14 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) new_filter = FT_EXTERNAL_CONTENT_FILTER; } #endif + else if (strncmp(buf, "CLIENT-BODY-FILTER:", 19) == 0) + { + new_filter = FT_CLIENT_BODY_FILTER; + } + else if (strncmp(buf, "CLIENT-BODY-TAGGER:", 19) == 0) + { + new_filter = FT_CLIENT_BODY_TAGGER; + } /* * If this is the head of a new filter block, make it a @@ -1182,6 +1190,14 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) new_bl->name = chomp(buf + 16); } #endif + else if (new_filter == FT_CLIENT_BODY_FILTER) + { + new_bl->name = chomp(buf + 19); + } + else if (new_filter == FT_CLIENT_BODY_TAGGER) + { + new_bl->name = chomp(buf + 19); + } else { new_bl->name = chomp(buf + 21); @@ -1226,7 +1242,9 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) bl = new_bl; log_error(LOG_LEVEL_RE_FILTER, "Reading in filter \"%s\" (\"%s\")", bl->name, bl->description); - +#ifdef FEATURE_EXTENDED_STATISTICS + register_filter_for_statistics(bl->name); +#endif freez(buf); continue; } @@ -1238,7 +1256,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) /* Save the code as "pattern", but do not compile anything. */ if (bl->patterns->first != NULL) { - log_error(LOG_LEVEL_FATAL, "External filter '%s' contains several jobss. " + log_error(LOG_LEVEL_FATAL, "External filter '%s' contains several jobs. " "Did you forget to escape a line break?", bl->name); } @@ -1323,7 +1341,8 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) } else { - log_error(LOG_LEVEL_ERROR, "Ignoring job %s outside filter block in %s, line %d", + log_error(LOG_LEVEL_ERROR, + "Ignoring job %s outside filter block in %s, line %lu", buf, csp->config->re_filterfile[fileid], linenum); } freez(buf);