RFR: 8262027: Improve how HttpConnection detects a closed channel when taking/returning a connection to the pool [v2]

Daniel Fuchs dfuchs at openjdk.java.net
Fri Feb 19 19:01:07 UTC 2021


On Fri, 19 Feb 2021 18:52:23 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove commented code in test
>
> test/jdk/java/net/httpclient/ProxyServer.java line 390:
> 
>> 388:                             clientSocket.shutdownInput();
>> 389:                             close();
>> 390:                             return;
> 
> I realise it isn't related to this change, but why is the test proxy closing the connection?

There's no guarantee that the proxy will have read all the bytes sent by the client - even if it attempts to drain the connection. So the only sane reaction if you're not going to parse the request body is to close the connection.

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

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


More information about the net-dev mailing list