X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=urlmatch.c;h=1e10c077440b95c31559835f96531e23c20c9afe;hp=3cd1147cc521abb4fa77a11a38b35407c45b7e8b;hb=ed36fcd3daa7d4696342ebe738d36c4348705cd5;hpb=d718332b42f884d9c3c2fd0cfa9b83f4973c6971 diff --git a/urlmatch.c b/urlmatch.c index 3cd1147c..1e10c077 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -105,7 +105,7 @@ void free_http_request(struct http_request *http) * Description : Splits the domain name so we can compare it * against wildcards. It used to be part of * parse_http_url, but was separated because the - * same code is required in chat in case of + * same code is required in chat() in case of * intercepted requests. * * Parameters : @@ -245,7 +245,7 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr /* - * Split URL into protocol,hostport,path. + * Split URL into protocol, hostport, path. */ { char *buf; @@ -263,7 +263,9 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr else if (strncmpic(url_noproto, "https://", 8) == 0) { /* - * Should only happen when called from cgi_show_url_info(). + * Should only happen when called from cgi_show_url_info() + * or when the request was https-inspected and the request + * line got rewritten. */ url_noproto += 8; http->ssl = 1; @@ -1204,9 +1206,9 @@ jb_err create_pattern_spec(struct pattern_spec *pattern, char *buf) const unsigned flag; } tag_pattern[] = { { "TAG:", 4, PATTERN_SPEC_TAG_PATTERN}, - #ifdef FEATURE_CLIENT_TAGS +#ifdef FEATURE_CLIENT_TAGS { "CLIENT-TAG:", 11, PATTERN_SPEC_CLIENT_TAG_PATTERN}, - #endif +#endif { "NO-REQUEST-TAG:", 15, PATTERN_SPEC_NO_REQUEST_TAG_PATTERN}, { "NO-RESPONSE-TAG:", 16, PATTERN_SPEC_NO_RESPONSE_TAG_PATTERN} }; @@ -1261,6 +1263,17 @@ void free_pattern_spec(struct pattern_spec *pattern) if (pattern == NULL) return; freez(pattern->spec); + + if (!(pattern->flags & PATTERN_SPEC_URL_PATTERN)) + { + if (pattern->pattern.tag_regex) + { + regfree(pattern->pattern.tag_regex); + freez(pattern->pattern.tag_regex); + } + return; + } + #ifdef FEATURE_PCRE_HOST_PATTERNS if (pattern->pattern.url_spec.host_regex) { @@ -1277,11 +1290,6 @@ void free_pattern_spec(struct pattern_spec *pattern) regfree(pattern->pattern.url_spec.preg); freez(pattern->pattern.url_spec.preg); } - if (pattern->pattern.tag_regex) - { - regfree(pattern->pattern.tag_regex); - freez(pattern->pattern.tag_regex); - } }