RFR: 8296410: HttpClient throws java.io.IOException: no statuscode in response for HTTP2
Conor Cleary
ccleary at openjdk.org
Fri Feb 3 12:52:49 UTC 2023
On Mon, 23 Jan 2023 14:51:57 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
> The changes in this PR look good to me. While looking at the source code, I noticed that the `Stream` class has a `PushedStream` nested class which too has a similar implementation in `handleResponse()`. I haven't yet checked the spec related to this; do you know if this code too will need a similar fix?
@jaikiran new changes have made modifications to `PushedStream::handleResponse`. What follows is a short note on how this differs from the changes with non-PushedStreams.
A `PushedStream` contains a CompletableFuture `pushCF` which can finish in one of two ways:
- `pushCF.complete()` if a status code is included in response headers from the server
- `pushCf.completeExceptionally()` if no status code included in server response headers
If any additional HEADERS frames (or frames of any other kind that are permitted in this situation) are received, the only effect that these changes will have is to produce a log stating the presence of trailing headers. It will not cause `pushCF` to complete exceptionally as it has either already done this or completed successfully.
This differs from the implementation of `Stream::handleResponse` before the changes made in this PR as Trailing headers without a status code would cause an `IOException` to be thrown on the given response thread.
-------------
PR: https://git.openjdk.org/jdk/pull/12028
More information about the net-dev
mailing list