On Fri, 19 Apr 2024 09:54:48 GMT, Daniel Jeliński <[email protected]> wrote:
> This is not as complex as I expected it to be. Which is a good thing! > > Some tests are failing with this change. See: > > ``` > test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java > test/jdk/java/net/Authenticator/B4769350.java > ``` > > These tests don't close the exchange or the output stream after sending the > response, and the headers are never flushed. Users might have similar code, > so I think a release note might be needed. I think this is a trivial fix. We should be able to either: 1) Flush the FixedLengthOutputStream when the bytes remaining is 0. 2) Always flush the output stream after an exchange completes. This won't affect performance if it has already been flushed()/closed() previously. I think 1 is the better option - because you can't really use a chunked output stream without flushing or closing the stream - as the client would hang. ------------- PR Comment: https://git.openjdk.org/jdk/pull/18667#issuecomment-2066834030
