What is moreover a trouble is that the connection wasn't released after the
failed post. Indeed as I call method.releaseConnection() and that response
Inputstream is empty, I didn't see anything like
HttpConnectionManager.releaseConnection:  Release connection for
[EMAIL PROTECTED]
after that request, whereas every other have it.

You are correct. It seems if an error occurs in HttpMethodBase.execute() before the response stream is set the connection will not be released. The attached patch should fix this. I will go ahead and commit this one after alpha 3 if all agree.


Mike
Index: java/org/apache/commons/httpclient/HttpMethodBase.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
retrieving revision 1.116
diff -u -r1.116 HttpMethodBase.java
--- java/org/apache/commons/httpclient/HttpMethodBase.java      25 Feb 2003 02:10:16 
-0000      1.116
+++ java/org/apache/commons/httpclient/HttpMethodBase.java      25 Feb 2003 19:11:54 
-0000
@@ -1188,7 +1188,9 @@
                 // attempting cleanup, don't care about exception.
             }
         }
-
+        // Make sure the connection has been released. If the response stream
+        // has not been set, this is the only way to release the connection.
+        ensureConnectionRelease();
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to