RFR: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input

Volkan Yazıcı duke at openjdk.org
Tue Jan 14 08:57:34 UTC 2025


Adds `limiting()` factory methods to `HttpResponse.Body{Handlers,Subscribers}` to handle excessive server input in `HttpClient`. I would appreciate your input whether `discardExcess` should be kept or dropped. I plan to file a CSR once there is an agreement on the PR.

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

Commit messages:
 - Move `cancel()` after `onComplete()`/`onError()`
 - Remove `request()` calls
 - Rename `excessDiscarded` to `discardExcess`
 - Add `limiting()` to `HttpResponse`

Changes: https://git.openjdk.org/jdk/pull/23096/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23096&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8328919
  Stats: 526 lines in 3 files changed: 526 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/23096.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23096/head:pull/23096

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


More information about the net-dev mailing list