On Tue, 30 May 2023 11:26:19 GMT, Daniel Jeliński <[email protected]> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   If RESET is received before the final response has been received the 
>> request should be cancelled too
>
> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 529:
> 
>> 527:                     debug.log("Received 100 statusCode, but FIN bit is 
>> set");
>> 528:                 }
>> 529:                 cancelImpl(new IOException("stream closed after 100, no 
>> other response expected"));
> 
> This will produce the wrong error code; see 
> https://datatracker.ietf.org/doc/html/rfc9113#name-http-message-framing :
>> An interim response consists of a 
>> [HEADERS](https://datatracker.ietf.org/doc/html/rfc9113#HEADERS) frame 
>> (which might be followed by zero or more 
>> [CONTINUATION](https://datatracker.ietf.org/doc/html/rfc9113#CONTINUATION) 
>> frames) containing the control data and header section of an interim (1xx) 
>> HTTP response (see [Section 
>> 15](https://www.rfc-editor.org/rfc/rfc9110#section-15) of 
>> [[HTTP](https://datatracker.ietf.org/doc/html/rfc9110)]). A 
>> [HEADERS](https://datatracker.ietf.org/doc/html/rfc9113#HEADERS) frame with 
>> the END_STREAM flag set that carries an informational status code is 
>> [malformed](https://datatracker.ietf.org/doc/html/rfc9113#malformed) 
>> ([Section 8.1.1](https://datatracker.ietf.org/doc/html/rfc9113#malformed)).
> 
>> Malformed requests or responses that are detected MUST be treated as a 
>> [stream 
>> error](https://datatracker.ietf.org/doc/html/rfc9113#StreamErrorHandler) 
>> ([Section 
>> 5.4.2](https://datatracker.ietf.org/doc/html/rfc9113#StreamErrorHandler)) of 
>> type 
>> [PROTOCOL_ERROR](https://datatracker.ietf.org/doc/html/rfc9113#PROTOCOL_ERROR).
> 
> as far as I could tell, `cancelImpl` sends `CANCEL` error code.

Fixed in 
https://git.openjdk.org/jdk/pull/14207/files/f046291f4ace4e6ccc932e67dcb8a3d12e5f788a

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14207#discussion_r1210359741

Reply via email to