RFR: 6968351: httpserver clashes with delayed TCP ACKs for low Content-Length [v4]

robert engels duke at openjdk.org
Fri Apr 19 18:20:58 UTC 2024


On Fri, 19 Apr 2024 18:15:26 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>>> The problem with closing a chunked stream is that it flushes both before and after the final chunk. I assume it may also cause delays.
>>> 
>>> The only case when you don't need to close the exchange or the output stream is when your response contains no content.
>> 
>> Can you point me to the code covering the before and after the final chunk? I would think the before flush should be removed.
>
> https://github.com/openjdk/jdk/blob/b704e91241b0f84d866f50a8f2c6af240087cb29/src/jdk.httpserver/share/classes/sun/net/httpserver/ChunkedOutputStream.java#L140-L144

I figured out what you are referring to. Let me look at this, I am pretty sure I can remove the first flush.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18667#discussion_r1572747571


More information about the net-dev mailing list