mbecke 2003/10/13 05:19:22 Modified: httpclient/src/java/org/apache/commons/httpclient Tag: HTTPCLIENT_2_0_BRANCH HttpMethodBase.java Log: Adds some logging. Submitted by: Oleg Kalnichevski Reviewed by: Michael Becke Revision Changes Path No revision No revision 1.159.2.14 +10 -6 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.159.2.13 retrieving revision 1.159.2.14 diff -u -r1.159.2.13 -r1.159.2.14 --- HttpMethodBase.java 12 Oct 2003 04:02:20 -0000 1.159.2.13 +++ HttpMethodBase.java 13 Oct 2003 12:19:22 -0000 1.159.2.14 @@ -868,12 +868,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; } @@ -2053,7 +2056,7 @@ } } } else { - if (isStrictMode() && LOG.isWarnEnabled()) { + if (LOG.isWarnEnabled()) { LOG.warn("Transfer-Encoding is set but does not contain \"chunked\": " + transferEncoding); } @@ -2066,6 +2069,7 @@ int 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]