Index: src/java/org/apache/commons/httpclient/HttpConnection.java =================================================================== --- src/java/org/apache/commons/httpclient/HttpConnection.java (revision 230416) +++ src/java/org/apache/commons/httpclient/HttpConnection.java (working copy) @@ -869,8 +869,11 @@ public boolean isResponseAvailable() throws IOException { LOG.trace("enter HttpConnection.isResponseAvailable()"); - assertOpen(); - return this.inputStream.available() > 0; + if (this.isOpen) { + return this.inputStream.available() > 0; + } else { + return false; + } } /** Index: src/java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== --- src/java/org/apache/commons/httpclient/HttpMethodBase.java (revision 230416) +++ src/java/org/apache/commons/httpclient/HttpMethodBase.java (working copy) @@ -1071,19 +1071,15 @@ * @since 2.0 */ public void releaseConnection() { - - if (responseStream != null) { - try { - // FYI - this may indirectly invoke responseBodyConsumed. - responseStream.close(); - } catch (IOException e) { - // the connection may not have been released, let's make sure - ensureConnectionRelease(); + try { + if (this.responseStream != null) { + try { + // FYI - this may indirectly invoke responseBodyConsumed. + this.responseStream.close(); + } catch (IOException ignore) { + } } - } else { - // Make sure the connection has been released. If the response - // stream has not been set, this is the only way to release the - // connection. + } finally { ensureConnectionRelease(); } }