RFR [12]: java.net.http.HttpClient hangs on 204 reply without Content-length 0
Daniel Fuchs
daniel.fuchs at oracle.com
Mon Oct 15 11:53:12 UTC 2018
Hi Michael,
On 15/10/2018 11:54, Michael McMahon wrote:
> Could I get the following fix reviewed please.
>
> http://cr.openjdk.java.net/~michaelm/8211437/webrev.1/index.html
Looks good in general.
In MultiExchange.java:
236 T nullBody = cf.get();
Though technically the body should be available by the
time we reach this line, since you completed the subscriber
just before, we can't really make any assumption on the
implementation of the subscriber.
So for the sake of robustness we should probably use
getBody().handle(...) to complete `result`
rather than calling cf.get();
Also I wonder what should happen if a body is present:
Should we simply read it instead?
Because if we don't then we should close the connection (HTTP/1.1)
or reset the stream (HTTP/2) - which probably means getting back
to the concrete exchange implementation to make sure that
happens.
best regards,
-- daniel
>
> Thanks,
>
> Michael.
More information about the net-dev
mailing list