X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=parsers.c;h=b65474ce3c3b3a7725c854c75e9410c4abfe1f54;hp=e48ae25fc613f3236221d173ecfc69efb3518bd0;hb=7013650df7f9ce96a09c4dd4a7d5979ece698fe9;hpb=2ce0e12445718fed0b44598b70dd18525fb6620b diff --git a/parsers.c b/parsers.c index e48ae25f..b65474ce 100644 --- a/parsers.c +++ b/parsers.c @@ -4,8 +4,8 @@ * * Purpose : Declares functions to parse/crunch headers and pages. * - * Copyright : Written by and Copyright (C) 2001-2017 the - * Privoxy team. http://www.privoxy.org/ + * Copyright : Written by and Copyright (C) 2001-2020 the + * Privoxy team. https://www.privoxy.org/ * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -633,6 +633,7 @@ jb_err decompress_iob(struct client_state *csp) if (bufsize >= csp->config->buffer_limit) { log_error(LOG_LEVEL_ERROR, "Buffer limit reached while decompressing iob"); + freez(buf); return JB_ERR_MEMORY; } @@ -1185,7 +1186,7 @@ jb_err sed(struct client_state *csp, int filter_server_headers) } -#ifdef FEATURE_HTTPS_FILTERING +#ifdef FEATURE_HTTPS_INSPECTION /********************************************************************* * * Function : sed_https @@ -1215,14 +1216,27 @@ jb_err sed_https(struct client_state *csp) csp->headers->first = csp->https_headers->first; csp->headers->last = csp->https_headers->last; + /* + * Start with fresh tags. Already exising tags may + * be set again. This is necessary to overrule + * URL-based patterns. + */ + destroy_list(csp->tags); + + /* + * We want client header filters and taggers + * so temporarly remove the flag. + */ + csp->flags &= ~CSP_FLAG_CLIENT_HEADER_PARSING_DONE; err = sed(csp, FILTER_CLIENT_HEADERS); + csp->flags |= CSP_FLAG_CLIENT_HEADER_PARSING_DONE; csp->headers->first = headers.first; csp->headers->last = headers.last; return err; } -#endif /* def FEATURE_HTTPS_FILTERING */ +#endif /* def FEATURE_HTTPS_INSPECTION */ /********************************************************************* @@ -4532,7 +4546,7 @@ jb_err get_destination_from_headers(const struct list *headers, struct http_requ } -#ifdef FEATURE_HTTPS_FILTERING +#ifdef FEATURE_HTTPS_INSPECTION /********************************************************************* * * Function : get_destination_from_https_headers @@ -4611,7 +4625,7 @@ jb_err get_destination_from_https_headers(const struct list *headers, struct htt return JB_ERR_OK; } -#endif /* def FEATURE_HTTPS_FILTERING */ +#endif /* def FEATURE_HTTPS_INSPECTION */ /*********************************************************************