On Mon, 3 Nov 2025 10:10:50 GMT, Michael McMahon <[email protected]> wrote:

>> The `ranges` list in the arguments is constructed so that each range's end 
>> option does not exceed the file size: if a requested range goes beyond the 
>> file lengh, it is clamped accordingly.
>> Therefore, I don't think any foundamental change is needed here.
>> 
>> We could add an `assert` (and a comment) to make this assumption explict, or 
>> possibly throw an IOE in case the file was truncated or modified during 
>> sending.
>
> I definitely don't want code that allows a `Content-Range: bytes 1000-2000` 
> to be written and treated as normal if the file hits EOF 10 bytes short. Even 
> if the situation cannot arise due to higher level checks, I'd like to see IOE 
> thrown rather than breaking from the loop.

Thanks for the clarification.
I've updated the implementation accordingly.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2490551797

Reply via email to