You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Ames <am...@gmail.com> on 2011/08/26 00:01:23 UTC

Re: svn commit: r1161767 - /httpd/httpd/trunk/modules/http/byterange_filter.c

On Thu, Aug 25, 2011 at 5:43 PM, <sf...@apache.org> wrote:

>
> avoid inserting the same bucket into bbout twice, causing an endless loop
>
> --- httpd/httpd/trunk/modules/http/byterange_filter.c (original)
> +++ httpd/httpd/trunk/modules/http/byterange_filter.c Thu Aug 25 21:43:32
> 2011
> @@ -195,8 +195,8 @@ static apr_status_t copy_brigade_range(a
>             return rv;
>         }
>
> -        APR_BRIGADE_INSERT_TAIL(bbout, copy);
>         if (e == first) {
> +            APR_BRIGADE_INSERT_TAIL(bbout, copy);
>             if (off_first != start64) {
>                 rv = apr_bucket_split(copy, (apr_size_t)(start64 -
> off_first));
>                 if (rv == APR_ENOTIMPL) {
>

?  Isn't "copy" going to be a new bucket on each pass of the while() loop?
Suppose we have 3 buckets and need to split buckets #1 and #3 to satisfy the
range.  We also need a copy of bucket #2 in the output brigade.  I don't see
where it is happening with this patch.

Greg

Re: svn commit: r1161767 - /httpd/httpd/trunk/modules/http/byterange_filter.c

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Friday 26 August 2011, Greg Ames wrote:
> ?  Isn't "copy" going to be a new bucket on each pass of the
> while() loop? Suppose we have 3 buckets and need to split buckets
> #1 and #3 to satisfy the range.  We also need a copy of bucket #2
> in the output brigade.  I don't see where it is happening with
> this patch.

True, that patch is broken, too :-( Will fix in a minute.