mbecke 2003/10/14 19:12:18
Modified: httpclient/src/java/org/apache/commons/httpclient
HttpMethodDirector.java
Log:
Fixes connection release problem with Head methods.
PR: 23703
Submitted by: Michael Becke
Reviewed by: Oleg Kalnichevski
Revision Changes Path
1.6 +7 -6
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
Index: HttpMethodDirector.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodDirector.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HttpMethodDirector.java 8 Oct 2003 23:34:16 -0000 1.5
+++ HttpMethodDirector.java 15 Oct 2003 02:12:18 -0000 1.6
@@ -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();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]