On Fri, August 26, 2011 13:37, Jim Jagielski wrote:
> I still think that your version is wrong wrong wrong and am
> tempted to veto it.
>
> It completely invalidates what ap_set_byterange() is designed to
> do (set r->range) as well as removes the ability to count
> overlaps, non-ascends, etc
r->range is documented as "The Range: header", and ap_set_byterange() sets
it to the value sent by the client. I don't think there is any specific
need to set r->range to a textual representation of what
ap_byterange_filter() chooses to do with the header. Or can you explain in
more detail why r->range needs to be updated?
And the counting logic is still possible, it just has to go inside the if
block where the merging is done, too:
if (i > 0) {
if (!(ranges[i].start > ranges[i-1].end + 1 &&
ranges[i].end < ranges[i-1].start - 1))
{
if (ranges[i].start < ranges[i-1].start)
ranges[i-1].start = ranges[i].start;
if (ranges[i].end > ranges[i-1].end)
ranges[i-1].end = ranges[i].end;
continue;
}
}