RFR: 8342075: HttpClient: improve HTTP/2 flow control checks [v2]

Daniel Fuchs dfuchs at openjdk.org
Tue Oct 22 14:25:23 UTC 2024


On Tue, 22 Oct 2024 14:09:29 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions from code review
>>   
>>   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
>
> src/java.net.http/share/classes/jdk/internal/net/http/WindowUpdateSender.java line 127:
> 
>> 125:     // corrective actions and return true.
>> 126:     private boolean checkWindowSizeExceeded(int len) {
>> 127:         int rcv = Math.addExact(received.get(), len);
> 
> `Math.addExact` throws an `ArithmeticException` if there is an overflow. I think we should catch it here (and take some action) instead of letting it propagate.

Good point. Maybe I should use a long to accumulate the two integers,

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21567#discussion_r1810830297


More information about the net-dev mailing list