Flush the connectionRead buffer before throwing connectionClosed.#567
Flush the connectionRead buffer before throwing connectionClosed.#567junjihashimoto wants to merge 1 commit intosnoyberg:masterfrom
Conversation
Are you saying that after
you expect a subsequent If yes, then I'm not convinced that this is "reasonable" to expect. I think a better solution might be to identify where and when |
Yes. In my case, the HTTP response has an HTTP header and body. After parsing the header, |
Do you know where the connection is closed? |
|
After rerunning it with |
When the response-data has already been read into the buffer, the connection is closed, and the data already read is sufficient, an exception is thrown and the data cannot be read.
In my case, I am using http-client in haskell/servant. The program can not read response data using getResponse and makeLengthReader.
I think haskell-servant/servant#994 might be related, but it's closed for some reason and I'm not sure how to fix it.
This PR flushes the connectionRead buffer before throwing connectionClosed.