RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2 [v5]

Conor Cleary ccleary at openjdk.org
Thu May 4 15:16:21 UTC 2023


On Wed, 26 Apr 2023 16:40:12 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8293786: Handle neg con length and closing bos in handler
>
> test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2TestExchangeImpl.java line 154:
> 
>> 152:             response.setFlag(HeadersFrame.END_STREAM);
>> 153:             conn.outputQ.put(response);
>> 154:             conn.outputQ.put(new ResetFrame(streamid, ResetFrame.NO_ERROR));
> 
> This doesn't seem right as reset should not be sent in the general case. Reset should only be sent if there remain data to read and we are unwilling to read it. In other words - this should be handled by closing the exchange (when the exchange is closed).

After offline discussions and testing, I added in an additonal check for an unconsumed input stream before sending the Reset Frame. This is similar to how the sending of the Reset Frame in BodyOutputStream.close() is handled.

In particular, the addition of this conditional check for an unconsumed input stream is used when a test sever handler calls`sendResponseHeaders(2xx, -1)`. This has the effect of marking the output stream as closed before `BodyOutputStream.close()` is called, which is why this seemilngly duplicated conditional sending of a reset is needed here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12694#discussion_r1185174592


More information about the net-dev mailing list