On Thu, 12 Nov 2026 12:21:50 GMT, Daniel Jeliński <[email protected]> wrote:

>> Roland Mesde has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Remove unused prepareToRelease, slicedToDataFrame and frameProcessed() 
>> from FramesDecoder
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 
> line 947:
> 
>> 945:             Log.logError(malformedFrame.getMessage());
>> 946:             int errorStream = malformedFrame.getErrorStream();
>> 947:             if (errorStream == 0) {
> 
> use the new isConnectionError getter here?

@djelinski Done.

> src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 
> line 957:
> 
>> 955:                         debug.log(() -> "Reset stream " + errorStream + 
>> ": "
>> 956:                                 + malformedFrame.getMessage());
>> 957:                     stream.onProtocolError(new ProtocolException(
> 
> why did you replace `resetStream` with the `isTerminalState` / 
> `onProtocolError` combo?

@djelinski resetStream() alone would cancel the request with the server but 
never report it to the caller, who would wait forever. onProtocolError() 
cancels it and fails the caller's request with a ProtocolException. We also 
don't cancel requests that have already finished or never started as indicated 
in RFC 9113 (5.1, 6.4).

> src/java.net.http/share/classes/jdk/internal/net/http/frame/FramesDecoder.java
>  line 553:
> 
>> 551:     private Http2Frame parseAltSvcFrame(int frameLength, int 
>> frameStreamid, int frameFlags) {
>> 552:         if (frameLength < 2) {
>> 553:             skipBytes(frameLength);
> 
> no need to skipBytes if you're returning a connection-closing malformedFrame.

@djelinski Done.

> src/java.net.http/share/classes/jdk/internal/net/http/frame/FramesDecoder.java
>  line 559:
> 
>> 557:         var len = getShort();
>> 558:         if (len > frameLength - 2) {
>> 559:             skipBytes(frameLength - 2);
> 
> same here

@djelinski Done.

> src/java.net.http/share/classes/jdk/internal/net/http/frame/MalformedFrame.java
>  line 73:
> 
>> 71:     }
>> 72: 
>> 73:     public int getErrorStream() {
> 
> could you drop the errorStream field and getter and use the streamId 
> inherited field instead? Keeping two fields (one unused) for the same 
> information (stream id) was the root cause of this bug, after all.

@djelinski Done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4553071603
PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4553070546
PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4553075662
PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4553074484
PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4553072651

Reply via email to