On Tue, Jun 17, 2003 at 11:33:48PM -0700, Justin Erenkrantz wrote:
> --On Tuesday, June 17, 2003 7:49 PM -0700 Greg Stein <[EMAIL PROTECTED]> 
> wrote:
> 
> >Hmm. It seems possible that deliver_report could fail before generating any
> >response. Thus, we want to test what the situation is, and deliver the 
> >error
> >or perform the new "ah, crap. punt" option.
> >
> >The logic would be like this:
> >
> >  if (!r->sent_bodyct)
> >    /* no data sent yet. handle the error normally. */
> >    return dav_handle_err(...)
> 
> I wonder if r->sent_bodyct could be 0 and there are data in the output 
> buffers that hasn't yet made it down to ap_http_header_filter...  -- justin

Definitely possible. But we have no better measure to detect that some
output has been generated. Once *some* output has been started (and, say, it
has been buffered by some filter), then the only likely error that would
come back from deliver_report is some kind of 5xx error. i.e. bad juju. In a
properly functioning server, that should never happen, so the exposure to
this kind of failure mode is very limited.

Presumably, non-fatal error conditions will be tested and checked before the
report delivery begins. Those will work just fine.

As Ben points out, HTTP status codes are at odds with a streamy output
style. That implies total buffering of the output if you want to ensure your
status code is always proper. And we know that we don't want to buffer...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Reply via email to