Hi Stefan, On Thu, Oct 8, 2015 at 12:06 PM, Stefan Eissing <stefan.eiss...@greenbytes.de> wrote: > > Index: modules/http2/h2_util.c > =================================================================== > --- modules/http2/h2_util.c (revision 1707467) > +++ modules/http2/h2_util.c (revision 1707468) > @@ -484,20 +484,39 @@ > > int h2_util_has_eos(apr_bucket_brigade *bb, apr_size_t len) > { > - apr_bucket *b, *end; > + apr_bucket *b; > > - apr_status_t status = last_not_included(bb, len, 0, 0, &end); > - if (status != APR_SUCCESS) { > - return status; > + if (len == 0) { > + /* special case: this is only true, if there are only meta > + * and an eos bucket in the brigade head. > + */ > + for (b = APR_BRIGADE_FIRST(bb); > + b != APR_BRIGADE_SENTINEL(bb); > + b = APR_BUCKET_NEXT(b)) > + { > + if (!APR_BUCKET_IS_METADATA(b) && b->length != 0) { > + break; > + } > + else if (APR_BUCKET_IS_EOS(b)) { > + return 1; > + } > + } > } > - > - for (b = APR_BRIGADE_FIRST(bb); > - b != APR_BRIGADE_SENTINEL(bb) && b != end; > - b = APR_BUCKET_NEXT(b)) > - { > - if (APR_BUCKET_IS_EOS(b)) { > - return 1; > + else { > + apr_bucket *end; > + apr_status_t status = last_not_included(bb, len, 0, 0, &end); > + if (status != APR_SUCCESS) { > + return status;
Do we want to assume EOS when last_not_included() fails? > } > + > + for (b = APR_BRIGADE_FIRST(bb); > + b != APR_BRIGADE_SENTINEL(bb) && b != end; > + b = APR_BUCKET_NEXT(b)) > + { > + if (APR_BUCKET_IS_EOS(b)) { > + return 1; > + } > + } > } > return 0; > } Regards, Yann.