httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Reporting errors from filters
Date Sat, 27 Jan 2001 00:27:34 GMT

> > This issue has come up before, but we never dealt with it.  We need to
> > deal with it now though.  Filters must have a way to actually report a
> > specific error to a handler, so that the server can report
> > errors.  Currently, the filters are supposed to return an HTTP error value
> > (at least that is the current design, but not implementation), but we
> > don't implement that well.
> Do you mean report errors for the error_log or for an HTTP error response?
> I think the former, since we are already in mid-stream of the response
> at that stage.

Actually, I meant the latter.  Reporting errors for the error_log can be
done by the filter itself.  We may not actually be in the middle of a
response at this stage.  Picture this scenario:

I have a filter that scans the data, comparing values in the response with
data I stored in a database.  I don't want to serve the file unless
everything matches.  I am willing to buffer all the data, and save it to
disk for this protection, but I require this protection.  I desperately
want to do this in a filter, but I can't return a valid HTTP error code to
the server.

Even more likely however, is a filter that checks something on the very
first call, and returns an error if something is wrong, or continues if
everything is good.  Right now, we can't do that.

> > I propose that we have ap_r* return an HTTP status code, so that filters
> > can return an HTTP status code, and we can get good errors from the
> > filter.
> The problem is that filter errors are not going to be HTTP errors,
> unless we are talking about the input filters.  Wouldn't it be easier
> to register a function pointer within the filter object that can
> be called when an error occurs?

I do need a way to create an HTTP error from within a filter.  I believe
others will need this as well.  Filter writers will need to understand
that they can't return an error code after they call ap_pass_brigade, but
that is the same rule we have for headers, so I don't believe that is a
big deal.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message