RFR: 8314978: Multiple server call from connection failing with expect100 in getOutputStream [v2]

Vyom Tewari vtewari at openjdk.org
Mon Sep 18 08:25:40 UTC 2023


On Fri, 15 Sep 2023 15:29:52 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> I am concerned that you are reusing the `rememberedException` field, which is used by getInputStream(). A server doesn't need to read the request body if it doesn't need it to send the response. So it could close the socket input and write the response body. The interaction between getOutputStream and getInputStream makes me uneasy here. I believe you may need to add more tests where the server doesn't read the request body before replying, and check that you can still read the response - for instance, it could be 404 with some text, and you shouldn't get an exception when reading the response body.

Your concern are valid here, i tested locally and as you said reusing the  'rememberedException' in getOutputStream is not a right way to fix the issue.

I will update the PR , and i will not reuse the 'rememberedException' in getOutputStream instead i will use a new variable to store the exception.

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

PR Comment: https://git.openjdk.org/jdk/pull/15483#issuecomment-1722955306


More information about the net-dev mailing list