RFR: 8299018: java/net/httpclient/HttpsTunnelAuthTest.java fails with java.io.IOException: HTTP/1.1 header parser received no bytes [v2]
Jaikiran Pai
jpai at openjdk.org
Mon Dec 19 10:45:50 UTC 2022
On Mon, 19 Dec 2022 10:41:05 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Please find here a trivial fix for a test issue in the HttpClient test's ProxyServer.
>>
>> The ProxyServer has a bad printf that throws an IllegalFormatConversionException, which causes the proxy to close the connection after sending a 407 request. Depending on timing, the client might attempt to reuse the closed (or soon to be closed) connection for sending authentication, which then gets the next POST request to fail.
>>
>> This failure is rare and intermittent (the client usually gets the close notification before it reuses the connection), but sometimes it doesn't.
>
> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>
> Update test/jdk/java/net/httpclient/ProxyServer.java
>
> Co-authored-by: Daniel Jelinski <djelinski1 at gmail.com>
test/jdk/java/net/httpclient/ProxyServer.java line 459:
> 457: int n = -1;
> 458: try {
> 459: n = Integer.parseInt(cl);
Hello Daniel, is it expected that the `content-length` header will always be present and if it isn't then the `ProxyServer` is expected to close the connection?
In its current form (even without the changes in this PR), if the `content-length` header is missing, this block will run into a `NumberFormatException` leading to the connection closure. Is that OK?
-------------
PR: https://git.openjdk.org/jdk/pull/11717
More information about the net-dev
mailing list