jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds] JCLOUDS-532: Properly close HTTP streams (#700)
Date Mon, 09 Mar 2015 23:38:35 GMT
OK, I've updated the pull request with a better approach. Now we don't buffer the error stream
by default, and just pass the open stream to the error handler. It is up to it to close the
stream, but after its execution we'll try to close it again (but won't fail if already closed
or an exception is thrown while trying to close it).

This way we pass an open stream tot he error handlers and make sure it is always closed when

My only doubt now is if just calling `close()` on the HTTP stream is enough or we'd better
consume all the content before with some helper method such as `Strings2.toStringAndClose`
or similar.

@andrewgaul is it safe to just close the stream? And, can you give another try to the tests
with the new approach? Thanks for your feedback!

Reply to this email directly or view it on GitHub:
View raw message