* 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 :
/*
- * Split URL into protocol,hostport,path.
+ * Split URL into protocol, hostport, path.
*/
{
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}
};
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)
{
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);
- }
}