On 08 Sep 2014, at 3:50 PM, Jim Jagielski <j...@jagunet.com> wrote:

> This is pretty cool... haven't played too much with it, but
> via inspection I like the implementation.
> 
> One question:
> 
> ===================================================================
> --- server/util_filter.c      (revision 1622873)
> +++ server/util_filter.c      (working copy)
> @@ -566,6 +566,16 @@
> {
>     if (next) {
>         apr_bucket *e;
> +        unsigned int activity;
> +        int empty = APR_BRIGADE_EMPTY(bb);
> +        apr_status_t status;
> ...
> +        while (APR_SUCCESS == status && empty) {
> +            next = next->next;
> +            if (next && next->c->activity == activity) {
> +                status = next->frec->filter_func.out_func(next, bb);
> +            }
> +            else {
> +                break;
> +            }
> +        }
> +
> +        return status;
> 
> Why does while check for empty? Wouldn't it be faster to
> wrap that while in a 'if (empty)' ? It would safe an
> addition check on a var that doesn't change on each loop
> thru the while().

It would - that was originally an if that became a while when I realised we had 
to compensate for multiple filters not calling ap_pass_brigade(), instead of 
just one.

The new patch takes out empty completely and instead tracks 
c->data_in_output_filters, which could change during the loop.

Regards,
Graham
—

Reply via email to