You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Yann Ylavic <yl...@gmail.com> on 2013/10/25 16:38:58 UTC

deflate_in_filter double ap_get_brigade() call

Helo,

The deflate_in_filter() (in trunk) currently does :

        rv = ap_get_brigade(f->next, ctx->bb, AP_MODE_READBYTES, block, 10);
        if (rv != APR_SUCCESS) {
            return rv;
        }

        /* zero length body? step aside */
        bkt = APR_BRIGADE_FIRST(ctx->bb);
        if (APR_BUCKET_IS_EOS(bkt)) {
            ap_remove_input_filter(f);
            return ap_get_brigade(f->next, bb, mode, block, readbytes);
        }

Is it intended to call ap_get_brigade() a second time when the EOS is there
the first time?
The second call is likely to return APR_EOF which is quite different than
EOS brigade...

Regards.

Re: deflate_in_filter double ap_get_brigade() call

Posted by Yann Ylavic <yl...@gmail.com>.
On Fri, Oct 25, 2013 at 4:38 PM, Yann Ylavic <yl...@gmail.com> wrote:

> The deflate_in_filter() (in trunk) currently does :
>

Same in 2.4.x.

Re: deflate_in_filter double ap_get_brigade() call

Posted by Eric Covener <co...@gmail.com>.
On Fri, Oct 25, 2013 at 10:38 AM, Yann Ylavic <yl...@gmail.com> wrote:
> Is it intended to call ap_get_brigade() a second time when the EOS is there
> the first time?
> The second call is likely to return APR_EOF which is quite different than
> EOS brigade...

It does seem fishy, probably copied from the earlier he blocks where
ap_get_brigade was not called at all before removing the filter to
step aside.

There does seem to be a zero-byte deflated response in the test
framework and it passes w/o the extra call.  W

-- 
Eric Covener
covener@gmail.com