RFR: 8263364: sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java wedged in getInputStream [v3]

Daniel Fuchs dfuchs at openjdk.java.net
Fri Jun 11 16:38:51 UTC 2021


On Fri, 11 Jun 2021 15:41:18 GMT, Ivan Šipka <isipka at openjdk.org> wrote:

>> @dfuch  could you please review, thank you.
>
> Ivan Šipka has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8263364: refactor

Looks good - small change still needed in `XServer::close`

test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java line 118:

> 116:         public void close() throws Exception {
> 117:             if (clientSocket != null) {
> 118:                 clientSocket.close();

Given that clientSocket is volatile you should really capture its value in a local variable:


var clientSocket = this.clientSocket;
if (clientSocket != null) {
    clientSocket.close();

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

PR: https://git.openjdk.java.net/jdk/pull/4472


More information about the net-dev mailing list