httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <>
Subject Re: problem with AddOutputFilterByType directive
Date Tue, 19 Feb 2002 06:18:40 GMT
On Mon, Feb 18, 2002 at 09:17:19PM -0800, Ian Holsman wrote:
> it doesn't do what it is supposed to do ALL the time.
> for example.. take mod-status.
> inside the handler it decides what type of content-type
> the program will return.

"bad module, fix module."

> this filterconfig won't be able to catch it.
> I'm also sure that mod-cgi can not determine the content-type
> of a CGI program before the handler hook either.

Not much we can do here since the content-type is completely

> so what I'm saying is this directive is going to confuse a WHOLE
> lot of people when it works some of the time.

No disagreement here, but I come back to "bad module, fix module."

> if this directive needs to be there (and I belive it should be)
> the filters themselves need to be added after the first bucket has been 
> passed to the brigade, as this is the only time we actually know for 
> certain what content-type we have.

I'm not terribly sure how workable this is.  I think that the
content-type needs to be set by the type_checker hook.  Then, the
fixups hook can be run knowing the content-type is valid.  If the
type_checker doesn't do what it says - mainly this:

"This routine is called to determine and/or set the various document
type information bits, like Content-type (via r->content_type),
language, et cetera."

Then we have issues.  But, I believe mod_status can be fixed
pretty trivially.  I'm not at all sure what to do about CGIs or
misbehaving modules.

> 	*) add a filter (with a priority of -1 FTYPE_CONTENT) which just
> 	   checks the content-type and adds the other filter if it
>  	   passes.

If we have to do this, then I think our architecture is in poor
shape.  I don't think a filter is the right place to do this - there
is way too much overhead in a filter to do this logic.  And, we'd
also be adding a filter after we've sent data down the filter chain.

(Don't get me wrong, I see your rationale behind this, but if the
only way to do this is via another filter, we've got problems.)

I could be wrong, but I think the way I did it is the right way to
do this given what we have now.  Anyone else?  Am I wrong?  -- justin

View raw message