httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <>
Subject Re: return value of a filter
Date Sun, 27 Aug 2000 11:41:18 GMT
On Sat, Aug 26, 2000 at 03:33:12PM -0400, Jeff Trawick wrote:
> I think a filter and thus ap_pass_brigade() should return apr_status_t
> and, if appropriate, return APR_SUCCESS (all input bytes processed) or
> an APR error code.  An additional filter parameter could be used if
> required to tell the caller how many bytes were processed|written.


On Sun, Aug 27, 2000 at 03:37:16AM -0700, Greg Stein wrote:
> The number of bytes sent is (as you point out) rather bogus. "sent" is a
> meaningless concept from the (theoretical) filter chain standpoint. The
> "consumed" notion is nice, but the design point is simply: I consumed the
> whole darn brigade. Byte counts are moot -- the caller is certainly not
> going to do anything with them.
> -0 on any kind of "out of band" query facility w.r.t bytes process/written.

I do agree that "bytes consumed" by itself is meaningless, especially
in the case where you're passing buckets of indeterminate size (like
file or pipe). I could think it's reasonable to want to know how many
buckets were consumed out of the brigade, and where in a bucket you
died, for error handling.

"Transmission failed in %s, byte %n", failed_bucket, num_bytes

View raw message