-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection leak on gzip/deflate responses #588
Comments
These helper functions are intended to wrap an InputStream which is consumed by the client which is why they're not closed here. The pattern: wrap with a buffered reader and call |
The usage of the function https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L280 leaks the stream |
At the point of code you've highlighted, it's decorating the body so that it can be consumed It's the client's responsibility to close the stream (through a coercion or explicitly by requesting the response as a stream). See https://github.com/dakrone/clj-http#output-coercion |
Please compare this to code in force-string and force-byte-array - both close the stream |
It looks like https://github.com/dakrone/clj-http/blob/3.x/src/clj_http/util.clj#L45 and https://github.com/dakrone/clj-http/blob/3.x/src/clj_http/util.clj#L99 are leaking connections - the input stream argument is not closed
The text was updated successfully, but these errors were encountered: