On Mon, 27 Mar 2023 18:37:58 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:

> This PR fixes a regression introduced in 
> [JDK-7026262](https://bugs.openjdk.org/browse/JDK-7026262); we started 
> closing the exchange instead of the output stream, and exchange closes the 
> connection when wrapped stream is not set. As an unintended side effect, the 
> server started closing connections after handling a HEAD request.
> 
> The proposed change is to set the wrapped stream to a zero-length 
> FixedLengthOutputStream before closing the exchange. This allows the 
> connection to be reused.
> 
> The attached test verifies if 2 consecutive HEAD requests use the same 
> connection. It succeeds with the proposed change, fails without it. All other 
> tier1-3 tests continue to pass.

This pull request has now been integrated.

Changeset: 3c4cd50e
Author:    Daniel Jeliński <djelin...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/3c4cd50e3cef5905d6c5dacddd6759e118bc50ca
Stats:     12 lines in 2 files changed: 3 ins; 5 del; 4 mod

8304963: HttpServer closes connection after processing HEAD after JDK-7026262

Reviewed-by: dfuchs

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

PR: https://git.openjdk.org/jdk/pull/13193

Reply via email to