mbecke 2003/10/13 05:22:24
Modified: httpclient/src/java/org/apache/commons/httpclient
HttpMethodBase.java
Log:
Adds some logging.
Submitted by: Oleg Kalnichevski
Reviewed by: Michael Becke
Revision Changes Path
1.182 +9 -5
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
Index: HttpMethodBase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -r1.181 -r1.182
--- HttpMethodBase.java 3 Oct 2003 20:57:35 -0000 1.181
+++ HttpMethodBase.java 13 Oct 2003 12:22:24 -0000 1.182
@@ -859,12 +859,15 @@
/**
* Sets whether or not the connection should be force-closed when no longer
* needed. This value should only be set to <code>true</code> in abnormal
- * circumstances.
+ * circumstances, such as HTTP protocol violations.
*
* @param b <code>true</code> if the connection must be closed,
<code>false</code>
* otherwise.
*/
protected void setConnectionCloseForced(boolean b) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Force-close connection: " + b);
+ }
this.connectionCloseForced = b;
}
@@ -1728,6 +1731,7 @@
long expectedLength = getResponseContentLength();
if (expectedLength == -1) {
if (canResponseHaveBody(statusLine.getStatusCode())) {
+ LOG.warn("Response content length is not known");
setConnectionCloseForced(true);
result = is;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]