RFR: 8347000: Bug in com/sun/net/httpserver/bugs/B6361557.java test

Michael McMahon michaelm at openjdk.org
Tue Jan 7 11:06:36 UTC 2025


On Mon, 6 Jan 2025 05:43:31 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to address the test-only issue noted in https://bugs.openjdk.org/browse/JDK-8347000?
> 
> As noted in that issue, the test issues HTTP requests with `Content-Length` set to `0` implying no request body. However, the code unintentionally sends additional bytes (14 bytes each request) as part of the request. The JDK's `HttpServer` implementation currently doesn't cause errors for such requests (although the HTTP/1.1 RFC expects an error to be raised). 
> 
> The change in this PR merely addresses the test code to not send these additional bytes. The test continues to pass after this change.

Change looks fine. 

We probably should have a test of the server that checks it handles pipelined requests correctly (if not optimally). Because a thread is basically assigned to a connection for the duration of a request, it means that pipelined requests will be (or should be in this impl) handled in sequence. Like I said, this isn't optimal, but then again, HTTP/1.1 pipelining has limitations that have been ameliorated by the newer versions of the protocol h2 and h3 (QUIC).

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

Marked as reviewed by michaelm (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22921#pullrequestreview-2534037822


More information about the net-dev mailing list