From: Jim Jagielski Date: Thu, 14 Feb 2008 14:48:13 +0000 (+0000) Subject: Change default of mod_substitute to flattening... X-Git-Tag: 2.3.0~965 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a865d69231ee15cff33bd3e7eeb65485fabbedd;p=apache Change default of mod_substitute to flattening... Via current discussion on dev@httpd git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@627764 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 598479ce57..aeced58359 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_substitute: The default is now flattening the buckets after + each substitution. The newly added 'q' flag allows for the + quicker, more efficient bucket-splitting if the user so + desires. [Jim Jagielski] + *) Added 'disablereuse' option for ProxyPass which, essentially, disables connection pooling for the backend servers. [Jim Jagielski] diff --git a/docs/manual/mod/mod_substitute.xml b/docs/manual/mod/mod_substitute.xml index fabd95f53d..180f28b5dc 100644 --- a/docs/manual/mod/mod_substitute.xml +++ b/docs/manual/mod/mod_substitute.xml @@ -37,7 +37,7 @@ Substitute Pattern to filter the response content -Substitute s/pattern/substitution/[inf] +Substitute s/pattern/substitution/[infq] directory .htaccess FileInfo @@ -59,7 +59,14 @@
f
The f flag causes mod_substitute to flatten the result of a substitution allowing for later substitutions to - take place on the boundary of this one.
+ take place on the boundary of this one. This is the default. +
q
+
The q flag causes mod_substitute to not + flatten the buckets after each substitution. This can + result in much faster response and a decrease in memory + utilization, but should only be used if there is no possibility + that the result of one substitution will ever match a pattern + or regex of a subsequent one.
Example diff --git a/modules/filters/mod_substitute.c b/modules/filters/mod_substitute.c index 592d140491..9774369926 100644 --- a/modules/filters/mod_substitute.c +++ b/modules/filters/mod_substitute.c @@ -488,7 +488,7 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line) subst_pattern_t *nscript; int is_pattern = 0; int ignore_case = 0; - int flatten = 0; + int flatten = 1; ap_regex_t *r = NULL; if (apr_tolower(*line) != 's') { @@ -525,8 +525,10 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line) is_pattern = 1; else if (delim == 'f') flatten = 1; + else if (delim == 'q') + flatten = 0; else - return "Bad Substitute flag, only s///[inf] are supported"; + return "Bad Substitute flag, only s///[infq] are supported"; flags++; }