RFR: 8299018: java/net/httpclient/HttpsTunnelAuthTest.java fails with java.io.IOException: HTTP/1.1 header parser received no bytes [v3]

Daniel Jeliński djelinski at openjdk.org
Mon Dec 19 16:10:50 UTC 2022


On Mon, 19 Dec 2022 13:11:16 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:
> 
>   Send "Connection: close" if closing. Accept not content-length for HEAD and GET.

LGTM.

test/jdk/java/net/httpclient/ProxyServer.java line 453:

> 451:             int m = cmdline.indexOf(' ');
> 452:             var method = (m > 0) ? cmdline.substring(0, m) : null;
> 453:             var nobody = List.of("GET", "HEAD");

I think we can include `CONNECT` in this list

test/jdk/java/net/httpclient/ProxyServer.java line 489:

> 487:                 }
> 488:             }
> 489:             if (n > 0 || n < -1) {

this part can be removed; we don't need any special handling for `content-length: -1`

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

Marked as reviewed by djelinski (Committer).

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


More information about the net-dev mailing list