> @@ -100,7 +100,7 @@ protected HttpResponse invoke(HttpURLConnection 
> connection) throws IOException,
>        HttpResponse.Builder<?> builder = HttpResponse.builder();
>        InputStream in = null;
>        try {
> -         in = consumeOnClose(connection.getInputStream());
> +         in = connection.getInputStream();

For pros and cons of consuming input stream, see section "What can you do to 
help with Keep-Alive?" of 
http://docs.oracle.com/javase/8/docs/technotes/guides/net/http-keepalive.html.

In summary, not consuming may "results in idle TCP connections" that "needs to 
be garbage collected when they are no longer referenced". It also recommends 
consuming + closing the error stream if there is an `IOException`. If one does 
not do that, "you need to be aware that more data could be on its way. Thus the 
connection may not be cleared for reuse."

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/435/files#r14757519

Reply via email to