--- HttpConnection.java.orig 2004-12-20 12:35:18.756665528 +0100 +++ HttpConnection.java.B 2004-12-20 12:41:16.741243600 +0100 @@ -1162,17 +1162,35 @@ } /** - * Release the connection. + * Releases the connection. In certain cases the connection cannot be + * released: + * + *
In either of these cases, false is returned. If the
+ * connection was successfully released, then true is
+ * returned.
+ *
+ * @return
+ * true if the connection was actually released,
+ * false otherwise.
*/
- public void releaseConnection() {
+ public boolean releaseConnection() {
LOG.trace("enter HttpConnection.releaseConnection()");
if (locked) {
LOG.debug("Connection is locked. Call to releaseConnection() ignored.");
+ return false;
} else if (httpConnectionManager != null) {
LOG.debug("Releasing connection back to connection manager.");
httpConnectionManager.releaseConnection(this);
+ return true;
} else {
LOG.warn("HttpConnectionManager is null. Connection cannot be released.");
+ return false;
}
}