httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: Input filter and setting HTTP headers in Apache 2.0
Date Sun, 28 Sep 2003 19:40:21 GMT
albertochan@att.net writes:

> [...]
> > 
> > Why don't you just write a fixup handler with libapreq-2?
> > AFAICT libapreq-2's mod_apreq (filter) handles these details
> > for you.
> > 
> 
> I did have the sense that what I was trying to do running under the
> HTTP_IN filter an impossible task to achieve. That is until I took a
> look at libapreq-2. Since my concern was modifying the request body, I
> misled myself by trying to write a connection filter, when a resource
> one was what I needed. 

It's quite a tricky problem.  mod_apreq went through quite a few
redesigns before arriving at the current implementation.  libapreq-2
users need mod_apreq to pull double duty as both

  (1) an active (pull) parser with a spool sitting right behind HTTP_IN.
  (2) a passive (push) parser sitting at the very end of the input filters.

Handlers that run before the content handler need mod_apreq in 
mode (1), whereas the content handler and any subsequent output 
filters need mode (2).  The current implementation of mod_apreq relies
on the filter_init() call to switch from mode (1) to mode (2).
I'm not sure how smoothly this changeover happens on an internal
redirect (httpd-apreq-2 doesn't have any tests written for redirects), 
but I suppose we'll cross that bridge as we come to it :-).

-- 
Joe Schaefer


Mime
View raw message