You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2007/08/24 02:54:16 UTC

svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Author: wrowe
Date: Thu Aug 23 17:54:15 2007
New Revision: 569204

URL: http://svn.apache.org/viewvc?rev=569204&view=rev
Log:
SEDFILTER has several anomolies; first, it's not SED syntax,
but more mod-rewrite like (and using the rewrite pcre parser).
Secondly, 'FILTER' in the filter name is redundant.  Simplify,
by renaming this 'REWRITE' filter.

Added:
    httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c
      - copied, changed from r568483, httpd/httpd/trunk/modules/experimental/mod_sedfilter.c
Removed:
    httpd/httpd/trunk/modules/experimental/mod_sedfilter.c
Modified:
    httpd/httpd/trunk/modules/experimental/config.m4

Modified: httpd/httpd/trunk/modules/experimental/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/config.m4?rev=569204&r1=569203&r2=569204&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/config.m4 (original)
+++ httpd/httpd/trunk/modules/experimental/config.m4 Thu Aug 23 17:54:15 2007
@@ -4,6 +4,6 @@
 APACHE_MODULE(example, example and demo module, , , no)
 APACHE_MODULE(case_filter, example uppercase conversion filter, , , no)
 APACHE_MODULE(case_filter_in, example uppercase conversion input filter, , , no)
-APACHE_MODULE(sedfilter, response body sed-like filtering, , , no)
+APACHE_MODULE(rewrite_filter, response content rewrite-like filtering, , , no)
 
 APACHE_MODPATH_FINISH

Copied: httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c (from r568483, httpd/httpd/trunk/modules/experimental/mod_sedfilter.c)
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c?p2=httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c&p1=httpd/httpd/trunk/modules/experimental/mod_sedfilter.c&r1=568483&r2=569204&rev=569204&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_sedfilter.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c Thu Aug 23 17:54:15 2007
@@ -15,7 +15,7 @@
  */
 
 /*
- * mod_sedfilter.c: Perform sed-like rewriting on the fly
+ * mod_rewrite_filter.c: Perform content rewriting on the fly
  */
 
 #include "httpd.h"
@@ -31,9 +31,9 @@
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
 
-static const char sedFilterName[] = "SEDFILTER";
+static const char rewrite_filter_name[] = "REWRITE";
 
-module AP_MODULE_DECLARE_DATA sedfilter_module;
+module AP_MODULE_DECLARE_DATA rewrite_filter_module;
 
 typedef struct {
     const apr_strmatch_pattern *pattern;
@@ -111,7 +111,7 @@
 
     sed_module_dcfg *cfg =
     (sed_module_dcfg *) ap_get_module_config(f->r->per_dir_config,
-                                             &sedfilter_module);
+                                             &rewrite_filter_module);
     sed_script *script;
 
     mybb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
@@ -513,7 +513,7 @@
 #define PROTO_FLAGS AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH
 static void register_hooks(apr_pool_t *pool)
 {
-    ap_register_output_filter(sedFilterName, sed_filter, NULL,
+    ap_register_output_filter(rewrite_filter_name, sed_filter, NULL,
                               AP_FTYPE_RESOURCE);
 }
 
@@ -523,7 +523,7 @@
     {NULL}
 };
 
-module AP_MODULE_DECLARE_DATA sedfilter_module = {
+module AP_MODULE_DECLARE_DATA rewrite_filter_module = {
     STANDARD20_MODULE_STUFF,
     create_sed_dcfg,            /* dir config creater */
     merge_sed_dcfg,             /* dir merger --- default is to override */



Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jim Jagielski wrote:
> 
> On Aug 23, 2007, at 8:54 PM, wrowe@apache.org wrote:
> 
>> Author: wrowe
>> Date: Thu Aug 23 17:54:15 2007
>> New Revision: 569204
>>
>> URL: http://svn.apache.org/viewvc?rev=569204&view=rev
>> Log:
>> SEDFILTER has several anomolies; first, it's not SED syntax,
>> but more mod-rewrite like (and using the rewrite pcre parser).
>> Secondly, 'FILTER' in the filter name is redundant.  Simplify,
>> by renaming this 'REWRITE' filter.
> 
> IMO, changing this from sedfilter to mod_rewrite_filter
> actually is more confusing (or would be) to end users, since
> we have a mod_rewrite already. IMO mod_rewrite_content
> would be a better choice, esp if mod_rewrite was called
> mod_rewrite_url...

Ack, I've heard that.  Was seeking a name that might fit better, but
I can certainly appreciate how this might be confusing.

Plus, it doesn't deserve the swiss army knife stigma that mod_rewrite has.

> In any case, I don't feel strongly enough about it
> to do anymore than send this single post...

Actually, please scroll down to the dialog, some good ideas down there.

I'm only waiting for a couple people to agree on a name to adjust this
once again :)

Bill

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
Sorry I didn't see Message-Id: <46...@rowe-clan.net>
before I sent this one...

The name came from the common usage of using mod_ext_filter
with sed to do inline text changes...



Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
Sorry I didn't see Message-Id: <46...@rowe-clan.net>
before I sent this one...

The name came from the common usage of using mod_ext_filter
with sed to do inline text changes...



Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Aug 23, 2007, at 8:54 PM, wrowe@apache.org wrote:

> Author: wrowe
> Date: Thu Aug 23 17:54:15 2007
> New Revision: 569204
>
> URL: http://svn.apache.org/viewvc?rev=569204&view=rev
> Log:
> SEDFILTER has several anomolies; first, it's not SED syntax,
> but more mod-rewrite like (and using the rewrite pcre parser).
> Secondly, 'FILTER' in the filter name is redundant.  Simplify,
> by renaming this 'REWRITE' filter.
>

IMO, changing this from sedfilter to mod_rewrite_filter
actually is more confusing (or would be) to end users, since
we have a mod_rewrite already. IMO mod_rewrite_content
would be a better choice, esp if mod_rewrite was called
mod_rewrite_url...

In any case, I don't feel strongly enough about it
to do anymore than send this single post...


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Aug 23, 2007, at 8:54 PM, wrowe@apache.org wrote:

> Author: wrowe
> Date: Thu Aug 23 17:54:15 2007
> New Revision: 569204
>
> URL: http://svn.apache.org/viewvc?rev=569204&view=rev
> Log:
> SEDFILTER has several anomolies; first, it's not SED syntax,
> but more mod-rewrite like (and using the rewrite pcre parser).
> Secondly, 'FILTER' in the filter name is redundant.  Simplify,
> by renaming this 'REWRITE' filter.
>

IMO, changing this from sedfilter to mod_rewrite_filter
actually is more confusing (or would be) to end users, since
we have a mod_rewrite already. IMO mod_rewrite_content
would be a better choice, esp if mod_rewrite was called
mod_rewrite_url...

In any case, I don't feel strongly enough about it
to do anymore than send this single post...


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jim Jagielski wrote:
> 
>> Ruediger Pluem wrote:
>>>
>>>> Roy T. Fielding wrote:
>>>>>
>>>>> or [*] mod_substitute
>>>
>>> [*] mod_substitute
> 
> I like mod_substitute... (I thought "filter" was redundant *duck* :) )

So mod_substitute it is :)

Fixing

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Aug 24, 2007, at 4:03 AM, Ian Holsman wrote:

> Ruediger Pluem wrote:
>> On 08/24/2007 05:30 AM, William A. Rowe, Jr. wrote:
>>
>>> Roy T. Fielding wrote:
>>>
>>>> On Aug 23, 2007, at 7:21 PM, William A. Rowe, Jr. wrote:
>>>>
>>>>> Joshua Slive wrote:
>>>>>
>>>>>> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>>>>>>
>>
>>
>>>>> I changed it, I'll be happy (urp) to change it again
>>>>>
>>>>>   [ ] mod_pcre_filter
>>>>>   [ ] mod_text_filter
>>>>>   [*] mod_subst_filter
>>>>>   [ ] mod_rewrite_filter
>>>>>
>>>> or [*] mod_substitute
>>>> or [*] mod_regex_replace, or ...
>>>>
>>
>>
>> [*] mod_substitute
>>
>>
> I'm the same as Ruediger, but would also suggest mod_replace.
> regards

I like mod_substitute... (I thought "filter" was redundant *duck* :) )

mod_edit_response ??


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Ian Holsman <li...@holsman.net>.
Ruediger Pluem wrote:
> On 08/24/2007 05:30 AM, William A. Rowe, Jr. wrote:
>   
>> Roy T. Fielding wrote:
>>     
>>> On Aug 23, 2007, at 7:21 PM, William A. Rowe, Jr. wrote:
>>>       
>>>> Joshua Slive wrote:
>>>>         
>>>>> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>>>>>           
>
>   
>>>> I changed it, I'll be happy (urp) to change it again
>>>>
>>>>   [ ] mod_pcre_filter
>>>>   [ ] mod_text_filter
>>>>   [*] mod_subst_filter
>>>>   [ ] mod_rewrite_filter
>>>>         
>>> or [*] mod_substitute
>>> or [*] mod_regex_replace, or ...
>>>       
>
>
> [*] mod_substitute
>
>   
I'm the same as Ruediger, but would also suggest mod_replace.
regards
Ian


> Regards
>
> RĂ¼diger
>
>
>   


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 08/24/2007 05:30 AM, William A. Rowe, Jr. wrote:
> Roy T. Fielding wrote:
>> On Aug 23, 2007, at 7:21 PM, William A. Rowe, Jr. wrote:
>>> Joshua Slive wrote:
>>>> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:

>>
>>> I changed it, I'll be happy (urp) to change it again
>>>
>>>   [ ] mod_pcre_filter
>>>   [ ] mod_text_filter
>>>   [*] mod_subst_filter
>>>   [ ] mod_rewrite_filter
>> or [*] mod_substitute
>> or [*] mod_regex_replace, or ...


[*] mod_substitute

Regards

RĂ¼diger


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Roy T. Fielding wrote:
> On Aug 23, 2007, at 7:21 PM, William A. Rowe, Jr. wrote:
>> Joshua Slive wrote:
>>> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>>>
>>>> I'm happy with a number of alternative names, mod_pcre_filter,
>>>> mod_text_filter,
>>>> mod_subst_filter, whatever, a number come to mind. The fact is,
>>>> mod_sed_filter
>>>> was nothing close to a sed implementation.
>>>
>>> I hate "mod_rewrite_filter". That's just asking for confusion with
>>> mod_rewrite. I prefer any of the above suggestions. (But then again,
>>> I'm not planning to make the change myself, so feel free to ignore me.)
> 
> That was my thought as well -- it is hard enough to document
> mod_rewrite already.
> 
>> I changed it, I'll be happy (urp) to change it again
>>
>>   [ ] mod_pcre_filter
>>   [ ] mod_text_filter
>>   [*] mod_subst_filter
>>   [ ] mod_rewrite_filter
> or [*] mod_substitute
> or [*] mod_regex_replace, or ...

Yup, more good suggestions.  (Transliterating your choices, and others
sure can consider those too.)

>> ...I believe we should extend the module to also accept env replacements
>> from the current request.  Sure, it's not there yet, but with that
>> feature, it maps to rewrite more closely than most anything.
> 
> And that's a good thing?  Modules are supposed to be, well, modular.

Of course :)

Actually, the implementation looks nothing like mod_rewrite's.  Given that
the pattern match/replace is the most expensive, and the list of these
substitutions is short, it's probably cheapest to build two pattern lists,
those with env substitutions and those without.  Those that have any
substitions can build a temp table of those entries, appending on a copy
of the constant list at request run time.  (Of course the constants
themselves would not be duplicated, just their indexes, and only if there
are any dynamic entries to process).

Bill

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "Roy T. Fielding" <fi...@gbiv.com>.
On Aug 23, 2007, at 7:21 PM, William A. Rowe, Jr. wrote:
> Joshua Slive wrote:
>> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
>>
>>> I'm happy with a number of alternative names, mod_pcre_filter,  
>>> mod_text_filter,
>>> mod_subst_filter, whatever, a number come to mind. The fact is,  
>>> mod_sed_filter
>>> was nothing close to a sed implementation.
>>
>> I hate "mod_rewrite_filter". That's just asking for confusion with
>> mod_rewrite. I prefer any of the above suggestions. (But then again,
>> I'm not planning to make the change myself, so feel free to ignore  
>> me.)

That was my thought as well -- it is hard enough to document
mod_rewrite already.

> I changed it, I'll be happy (urp) to change it again
>
>   [ ] mod_pcre_filter
>   [ ] mod_text_filter
>   [ ] mod_subst_filter
>   [ ] mod_rewrite_filter
>
> My vote is the last one.  Here's my thought...

mod_subst_filter, or mod_substitute, or mod_regex_replace, or ...

> ...I believe we should extend the module to also accept env  
> replacements
> from the current request.  Sure, it's not there yet, but with that  
> feature,
> it maps to rewrite more closely than most anything.

And that's a good thing?  Modules are supposed to be, well, modular.

....Roy


Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joshua Slive wrote:
> On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
> 
>> I'm happy with a number of alternative names, mod_pcre_filter, mod_text_filter,
>> mod_subst_filter, whatever, a number come to mind. The fact is, mod_sed_filter
>> was nothing close to a sed implementation.
> 
> I hate "mod_rewrite_filter". That's just asking for confusion with
> mod_rewrite. I prefer any of the above suggestions. (But then again,
> I'm not planning to make the change myself, so feel free to ignore me.)

I changed it, I'll be happy (urp) to change it again

  [ ] mod_pcre_filter
  [ ] mod_text_filter
  [ ] mod_subst_filter
  [ ] mod_rewrite_filter

My vote is the last one.  Here's my thought...

...I believe we should extend the module to also accept env replacements
from the current request.  Sure, it's not there yet, but with that feature,
it maps to rewrite more closely than most anything.

But cast away, and I'll switch.

Bill

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by Joshua Slive <jo...@slive.ca>.
On 8/23/07, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:

> I'm happy with a number of alternative names, mod_pcre_filter, mod_text_filter,
> mod_subst_filter, whatever, a number come to mind. The fact is, mod_sed_filter
> was nothing close to a sed implementation.

I hate "mod_rewrite_filter". That's just asking for confusion with
mod_rewrite. I prefer any of the above suggestions. (But then again,
I'm not planning to make the change myself, so feel free to ignore
me.)

Joshua.

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
wrowe@apache.org wrote:
> Author: wrowe
> Date: Thu Aug 23 17:54:15 2007
> New Revision: 569204
> 
> URL: http://svn.apache.org/viewvc?rev=569204&view=rev
> Log:
> SEDFILTER has several anomolies; first, it's not SED syntax,
> but more mod-rewrite like (and using the rewrite pcre parser).
> Secondly, 'FILTER' in the filter name is redundant.  Simplify,
> by renaming this 'REWRITE' filter.
> 
> Added:
>     httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c
>       - copied, changed from r568483, httpd/httpd/trunk/modules/experimental/mod_sedfilter.c

My -1 was out there for a number of months, without the essential objection
being addressed.  Since it wasn't addressed, I'm exercising my only alternative
to an outright veto.  If we can't find a compromise, of course we can revert
the entire story, but I'd like to avoid that.

I'm happy with a number of alternative names, mod_pcre_filter, mod_text_filter,
mod_subst_filter, whatever, a number come to mind. The fact is, mod_sed_filter
was nothing close to a sed implementation.  Yes, I'm more of an awk fanboi than
a sed user, but I'd expect a sed_filter to be exactly that.  I'm also completely
and perpetually irritated by some companies such as M$ which don't respect the
existing glossaries of computer science, insisting on inventing new words or
using the wrong words for old ideas :)

And before anyone claims it's near enough - yes - there really is one.
http//happygiraffe.net/mod_sed

Bill

Re: svn commit: r569204 - in /httpd/httpd/trunk/modules/experimental: config.m4 mod_rewrite_filter.c mod_sedfilter.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
wrowe@apache.org wrote:
> Author: wrowe
> Date: Thu Aug 23 17:54:15 2007
> New Revision: 569204
> 
> URL: http://svn.apache.org/viewvc?rev=569204&view=rev
> Log:
> SEDFILTER has several anomolies; first, it's not SED syntax,
> but more mod-rewrite like (and using the rewrite pcre parser).
> Secondly, 'FILTER' in the filter name is redundant.  Simplify,
> by renaming this 'REWRITE' filter.
> 
> Added:
>     httpd/httpd/trunk/modules/experimental/mod_rewrite_filter.c
>       - copied, changed from r568483, httpd/httpd/trunk/modules/experimental/mod_sedfilter.c

My -1 was out there for a number of months, without the essential objection
being addressed.  Since it wasn't addressed, I'm exercising my only alternative
to an outright veto.  If we can't find a compromise, of course we can revert
the entire story, but I'd like to avoid that.

I'm happy with a number of alternative names, mod_pcre_filter, mod_text_filter,
mod_subst_filter, whatever, a number come to mind. The fact is, mod_sed_filter
was nothing close to a sed implementation.  Yes, I'm more of an awk fanboi than
a sed user, but I'd expect a sed_filter to be exactly that.  I'm also completely
and perpetually irritated by some companies such as M$ which don't respect the
existing glossaries of computer science, insisting on inventing new words or
using the wrong words for old ideas :)

And before anyone claims it's near enough - yes - there really is one.
http//happygiraffe.net/mod_sed

Bill