On Tue, 24 Oct 2023 09:29:50 GMT, Conor Cleary <[email protected]> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 619:
>> 
>>> 617:             }
>>> 618:             if (!endStreamSeen) {
>>> 619:                 // If no END_STREAM flag seen, any RST_STREAM should 
>>> be handled here immediately
>> 
>> Suggestion:
>> 
>>             if (!endStreamSeen || !finalResponseCodeReceived) {
>>                 // If no END_STREAM flag seen, any RST_STREAM should be 
>> handled here immediately
>>                 // If the final response code was not received, then we 
>> should also handle
>>                 // the RST_STREAM immediately
>
> So by checking if the final response code is received, this makes sure that 
> the entire block of headers is processed therfore a status code will have 
> been received.

And then in the case where END_STREAM has already been seen, we call 
`requestBodyCF.complete(null);` to complete normally, as any RST_STREAM frames 
after an END_STREAM are not handled exceptionally.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15664#discussion_r1369876940

Reply via email to