You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by fabio rohrich <ro...@yahoo.it> on 2003/02/21 16:13:07 UTC

mod_blanks for apache 2

Hi.
We spoke long time about filtering in apache 1.3.
So far, I decided to write mod_blanks as a filter for
apache 2.x, even if I wrote a large part for apache
1.3 (ill port everything):)

Anyway,any suggestion on some modules for apache 2.x
that filter the output (I need to modify the html).

And, where can I find some docs (therei s only the
famous faq?)?
And, last thing, the whole collection of mail of this
list, whereis it?
Thanks a lot,
Fabio

______________________________________________________________________
Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html

Filter process

Posted by fabio rohrich <ro...@yahoo.it>.
Hi all,
I´d like to know how is the process I have to follow
for my filter. I need to modify the html content.
Is the same as in mod_acrono..?

Thanx.... :)




______________________________________________________________________
Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html

Re: mod_blanks for apache 2

Posted by "johannes m. richter" <jo...@gmx.net>.
>Anyway,any suggestion on some modules for apache 2.x
>that filter the output (I need to modify the html).

Perhaps you can use mod_injection as a good starting point.
http://pmade.org/pjones/software/mod_injection/

>And, last thing, the whole collection of mail of this
>list, whereis it?

On http://httpd.apache.org/lists.html some sites are mentioned.

Good luck!
johannes

-- 
The ability to make hyperlinks between information sources is arguably
the most important feature of that great repository of pet photographs
they call the Internet.  -- from a 3DML tutorial
- http://jgcl.at/ko/news.html - Bestell Dir den J-GCL AB Newsletter!


Re: Modify the content after having got it

Posted by Stas Bekman <st...@stason.org>.
Ian Holsman wrote:
> Stas Bekman wrote:
> 
>> Cliff Woolley wrote:
>>
>>> On Mon, 17 Mar 2003, Greg Ames wrote:
>>>
>>>
>>>>> I have 'data' datas long 'lenght'. If I try to modify
>>>>> the data I get and to send it again inside the bucket,
>>>>> it doesnt work.
>>>>
>>>>
>>>>
>>>> What kind of buckets do you have before you try to modify them?  You
>>>> can't modify some types of buckets.
>>>
>>>
>>>
>>>
>>> You're not supposed to modify the data in ANY kind of bucket.  
>>> Buckets are
>>> write-once read-many.  If you want to modify the data in a bucket, you
>>> have to do a bucket read, copy the data into a new buffer, modify it, 
>>> and
>>> place the new buffer into a new bucket, replacing the old bucket.
>>
>>
>>
>> Cliff, is this documented somewhere?
>>
>> Do you have to read-modify-replace even if you don't modify the length 
>> of the data? e.g. lowercasing all the data in the bucket?
> 
> 
> yes.
> always.
> you don't know what the backing store of the bucket is, and who else 
> could be referecing it at the same time.
> (shared mem/cache/memory mapped files are examples on where you don't 
> won't to modify the data).

Thanks Cliff.

While we are at the topic of removing buckets. Is it bad if the bucket removed 
from bb but not destroyed? It should be automatically purged when the pool it 
was allocated from is cleaned up, so we get a temp memory leak (while the pool 
is alive). Are there any other side effects I'm not aware of? I suspect that 
there could be a problem with these "other" resources, which aren't memory, 
because of the reference counting?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Modify the content after having got it

Posted by Ian Holsman <ia...@apache.org>.
Stas Bekman wrote:
> Cliff Woolley wrote:
> 
>> On Mon, 17 Mar 2003, Greg Ames wrote:
>>
>>
>>>> I have 'data' datas long 'lenght'. If I try to modify
>>>> the data I get and to send it again inside the bucket,
>>>> it doesnt work.
>>>
>>>
>>> What kind of buckets do you have before you try to modify them?  You
>>> can't modify some types of buckets.
>>
>>
>>
>> You're not supposed to modify the data in ANY kind of bucket.  Buckets 
>> are
>> write-once read-many.  If you want to modify the data in a bucket, you
>> have to do a bucket read, copy the data into a new buffer, modify it, and
>> place the new buffer into a new bucket, replacing the old bucket.
> 
> 
> Cliff, is this documented somewhere?
> 
> Do you have to read-modify-replace even if you don't modify the length 
> of the data? e.g. lowercasing all the data in the bucket?

yes.
always.
you don't know what the backing store of the bucket is, and who else could be referecing it at the 
same time.
(shared mem/cache/memory mapped files are examples on where you don't won't to modify the data).

> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 



Re: Modify the content after having got it

Posted by Stas Bekman <st...@stason.org>.
Cliff Woolley wrote:
> On Mon, 17 Mar 2003, Greg Ames wrote:
> 
> 
>>>I have 'data' datas long 'lenght'. If I try to modify
>>>the data I get and to send it again inside the bucket,
>>>it doesnt work.
>>
>>What kind of buckets do you have before you try to modify them?  You
>>can't modify some types of buckets.
> 
> 
> You're not supposed to modify the data in ANY kind of bucket.  Buckets are
> write-once read-many.  If you want to modify the data in a bucket, you
> have to do a bucket read, copy the data into a new buffer, modify it, and
> place the new buffer into a new bucket, replacing the old bucket.

Cliff, is this documented somewhere?

Do you have to read-modify-replace even if you don't modify the length of the 
data? e.g. lowercasing all the data in the bucket?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Modify the content after having got it

Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 17 Mar 2003, Greg Ames wrote:

> > I have 'data' datas long 'lenght'. If I try to modify
> > the data I get and to send it again inside the bucket,
> > it doesnt work.
>
> What kind of buckets do you have before you try to modify them?  You
> can't modify some types of buckets.

You're not supposed to modify the data in ANY kind of bucket.  Buckets are
write-once read-many.  If you want to modify the data in a bucket, you
have to do a bucket read, copy the data into a new buffer, modify it, and
place the new buffer into a new bucket, replacing the old bucket.

--Cliff

Re: Modify the content after having got it

Posted by Greg Ames <gr...@apache.org>.
fabio rohrich wrote:
>  Hi all,
> I'm able (easy job ) to catch the content in apache
> 2.x
> , but the problem is to modify it and to send it. I
> mean , I get the content throw the bucket brigade, and
> I have 'data' datas long 'lenght'. If I try to modify
> the data I get and to send it again inside the bucket,
> it doesnt work.
> So , how have I to behave in this situation? 
> Thanks a lot,
> Fabio

What kind of buckets do you have before you try to modify them?  You can't 
modify some types of buckets.

This is easy to answer if you use gdb.  Copy the .gdbinit file into your home 
directory.  Set a breakpoint at the beginning of your filter.  When it hits, 
type "dump_brigade bb" (or whatever you call the input brigade).

Good luck,
Greg


Modify the content after having got it

Posted by fabio rohrich <ro...@yahoo.it>.
 Hi all,
I'm able (easy job ) to catch the content in apache
2.x
, but the problem is to modify it and to send it. I
mean , I get the content throw the bucket brigade, and
I have 'data' datas long 'lenght'. If I try to modify
the data I get and to send it again inside the bucket,
it doesnt work.
So , how have I to behave in this situation? 
Thanks a lot,
Fabio

______________________________________________________________________
Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html

Re: mod_blanks for apache 2

Posted by fabio rohrich <ro...@yahoo.it>.
Great, I appreciate it.
This is not only open source... it's open mind and
open knowledge!
Fantastic :)



 --- Greg Ames <gr...@apache.org> ha scritto: >
Cliff Woolley wrote:
> 
>  >>Anyway,any suggestion on some modules for apache
> 2.x
>  >>that filter the output (I need to modify the
> html).
>  >>And, where can I find some docs (therei s only
> the
>  >>famous faq?)?
>  >
>  >
>  > You're going to have to learn about filters and
> bucket brigades if you
>  > haven't already.  Go read the slides from Greg
> Ames's talk on filters and
>  > my talk on bucket brigades from ApacheCon 2002.
>  >
>  > Filters:
> 
>  > Greg, if you don't mind, could you post them
> somewhere more
>  > generally-accessible?  Like on
> http://www.apache.org/~gregames/ would be
>  > cool.  =)
> 
> OK, done.  The slides are now at
> http://www.apache.org/~gregames/ap2filters.ppt
> 
> Greg
> 
> 

______________________________________________________________________
Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html

Re: mod_blanks for apache 2

Posted by Greg Ames <gr...@apache.org>.
Cliff Woolley wrote:

 >>Anyway,any suggestion on some modules for apache 2.x
 >>that filter the output (I need to modify the html).
 >>And, where can I find some docs (therei s only the
 >>famous faq?)?
 >
 >
 > You're going to have to learn about filters and bucket brigades if you
 > haven't already.  Go read the slides from Greg Ames's talk on filters and
 > my talk on bucket brigades from ApacheCon 2002.
 >
 > Filters:

 > Greg, if you don't mind, could you post them somewhere more
 > generally-accessible?  Like on http://www.apache.org/~gregames/ would be
 > cool.  =)

OK, done.  The slides are now at http://www.apache.org/~gregames/ap2filters.ppt

Greg



Re: mod_blanks for apache 2

Posted by Cliff Woolley <jw...@virginia.edu>.
On Fri, 21 Feb 2003, [iso-8859-1] fabio rohrich wrote:

> We spoke long time about filtering in apache 1.3.
> So far, I decided to write mod_blanks as a filter for
> apache 2.x, even if I wrote a large part for apache

Glad you saw the light.  ;)  It'll be much easier with 2.0.

> Anyway,any suggestion on some modules for apache 2.x
> that filter the output (I need to modify the html).
> And, where can I find some docs (therei s only the
> famous faq?)?

You're going to have to learn about filters and bucket brigades if you
haven't already.  Go read the slides from Greg Ames's talk on filters and
my talk on bucket brigades from ApacheCon 2002.

Filters:
  The slides are available on apachecon.com if you have an account there
(does viewing them require having attended the conference?  I don't know).
Greg, if you don't mind, could you post them somewhere more
generally-accessible?  Like on http://www.apache.org/~gregames/ would be
cool.  =)  Oh, and are the doxygen docs for httpd available on
httpd.apache.org anywhere?  A `find` on daedalus didn't reveal them.  If
not, we should fix that.  In the meanwhile, a slightly old version is
available on http://www.schumann.cx/docs/httpd/.

Bucket brigades:
  My slides are available via my apache.org website.  They're quite
comprehensive and are the best available documentation other than the
actual API docs.
  http://www.apache.org/~jwoolley/bucketbrigades/
  http://apr.apache.org/docs/apr-util/


> And, last thing, the whole collection of mail of this
> list, whereis it?

http://marc.theaimsgroup.com/ is the best resource I know of.


Re: mod_blanks for apache 2

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Fri, 21 Feb 2003, William A. Rowe, Jr. wrote:

> The easiest example is mod_ext_filter which is nothing but a simple
> pipe wrapper.  It invokes the given pipe command and filters the content
> through that pipe.

> >So far, I decided to write mod_blanks as a filter for
> >apache 2.x, even if I wrote a large part for apache
> >1.3 (ill port everything):)

It should be trivial to adapt

	http://www.apache.org/~dirkx/oscon2002/mod_acronym/

as it already parses html and substitutes/changes bits directly on an
in-memory buffer.

DWw


Re: mod_blanks for apache 2

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
The easiest example is mod_ext_filter which is nothing but a simple
pipe wrapper.  It invokes the given pipe command and filters the content
through that pipe.

Bill

At 09:13 AM 2/21/2003, fabio rohrich wrote:
>Hi.
>We spoke long time about filtering in apache 1.3.
>So far, I decided to write mod_blanks as a filter for
>apache 2.x, even if I wrote a large part for apache
>1.3 (ill port everything):)
>
>Anyway,any suggestion on some modules for apache 2.x
>that filter the output (I need to modify the html).
>
>And, where can I find some docs (therei s only the
>famous faq?)?
>And, last thing, the whole collection of mail of this
>list, whereis it?
>Thanks a lot,
>Fabio
>
>______________________________________________________________________
>Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
>http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html