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

Jaikiran Pai jpai at openjdk.org
Tue Jan 21 15:11:48 UTC 2025


On Tue, 21 Jan 2025 15:02:20 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>  Perhaps we should also add a test which verifies that the returned InputStream reaches EOF (and the is.read() calls complete with -1 eventually) when wrapped with a limiting BodyHandler with insufficient capacity.

Looking at the implementation of `BodyHandlers.ofInputStream()` it appears that such cases will result in an IOException being thrown from `read(...)` calls and not `-1`. So I stand corrected - the new test that we add should assert that the `IOException` gets thrown from `is.read(...)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23096#discussion_r1923899035


More information about the net-dev mailing list