On Tue, 10 Nov 2026 17:51:19 GMT, Roland Mesde <[email protected]> wrote:
>> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 1898:
>>
>>> 1896: } finally {
>>> 1897: stateLock.unlock();
>>> 1898: }
>>
>> This does not make sense to me. Can you explain?
>
> By line 1890, we know the server is finished sending on the stream. The lines
> check if the client finished too. The client never sends on a PushedStream
> instance, and for normal requests it is finished once it is sent
> (requestBodyCF.isDone()). In the first request on an upgraded connection,
> that is sent before the switch to HTTP2, the requestSent flag records that
> the client has finished.
I see. Can you add some comments to make the logic more clear?
Also I find the name `isClosed` to be a bit misleading here. Maybe `finReached`
or `transmissionFinished` would be a better fit, given what the method is
testing.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4528732026