RFR: 8054022: HttpURLConnection timeouts with Expect: 100-Continue and no chunking [v2]

Darragh Clarke duke at openjdk.org
Mon Apr 24 10:07:48 UTC 2023


> Currently it is possible for `HttpURLConnection` with the `Expect: 100-Continue` header to timeout awaiting for a server response. According to [RFC-7231](https://www.rfc-editor.org/rfc/rfc7231#section-5.1.1) a client `SHOULD NOT wait for an indefinite period before sending the message body`.
> 
> This PR changes the existing `expect100Continue` method to wait for a maximum of 5 seconds for a server response, this will be shorter if a timeout is set. If no response is received, the message is sent regardless.
> 
> Tests have been added to account for different scenarios that currently timeout, and the changes have been tested against tiers 1,2 and 3.

Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision:

  added additional tests, cleaned up code

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13330/files
  - new: https://git.openjdk.org/jdk/pull/13330/files/3da5096f..d8288cde

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13330&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13330&range=00-01

  Stats: 275 lines in 2 files changed: 127 ins; 87 del; 61 mod
  Patch: https://git.openjdk.org/jdk/pull/13330.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13330/head:pull/13330

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


More information about the net-dev mailing list