Index: HttpMethodDirector.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodDirector.java,v retrieving revision 1.5 diff -u -r1.5 HttpMethodDirector.java --- HttpMethodDirector.java 8 Oct 2003 23:34:16 -0000 1.5 +++ HttpMethodDirector.java 11 Oct 2003 03:15:11 -0000 @@ -166,10 +166,11 @@ // responseStream == null), as subclasses, might reset the stream, // for example, reading the entire response into a file and then // setting the file as the stream. - if (releaseConnection && connection != null) { + if ( + (releaseConnection || method.getResponseBodyAsStream() == null) + && connection != null + ) { connection.releaseConnection(); - } else if (method.getResponseBodyAsStream() == null) { - method.releaseConnection(); } }