On Tue, 10 Nov 2026 16:38:33 GMT, Daniel Fuchs <[email protected]> wrote:

>> This PR makes the HTTP2 client use MalformedFrame.errorStream. A PRIORITY 
>> frame with an invalid length resets its stream (based on RFC 9113) instead 
>> of closing the connection. In addition, invalid ALTSVC frames are now 
>> skipped.
>> 
>> Low risk - affects handling of malformed PRIORITY and ALTSVC frames.
>> 
>> Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:
>> 
>> make test TEST=test/jdk/java/net/httpclient
>> 
>> Results:
>> 
>> [windows-x64-specific-test.log](https://github.com/user-attachments/files/34636337/windows-x64-specific-test.log)
>> [macos-aarch64-specific-test.log](https://github.com/user-attachments/files/34636340/macos-aarch64-specific-test.log)
>> [linux-x64-specific-test.log](https://github.com/user-attachments/files/34636341/linux-x64-specific-test.log)
>> [linux-aarch64-specific-test.log](https://github.com/user-attachments/files/34636342/linux-aarch64-specific-test.log)
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33824#discussion_r4528468264

Reply via email to