On Fri, 15 Sep 2023 15:29:52 GMT, Daniel Fuchs <[email protected]> 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

Reply via email to