Index: java/org/apache/commons/httpclient/ConnectMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ConnectMethod.java,v
retrieving revision 1.7
diff -u -r1.7 ConnectMethod.java
--- java/org/apache/commons/httpclient/ConnectMethod.java 28 Jan 2003 04:40:20 -0000 1.7
+++ java/org/apache/commons/httpclient/ConnectMethod.java 1 Mar 2003 16:58:15 -0000
@@ -167,10 +167,29 @@
conn.printLine(line);
}
+ /**
+ * Does nothing. This should be handled by the actual method.
+ *
+ * @see HttpMethodBase#responseBodyConsumed()
+ */
+ protected void responseBodyConsumed() {
+ }
+ /**
+ * Returns true if the status code is anything other than
+ * SC_OK, false otherwise.
+ *
+ * @see HttpMethodBase#shouldCloseConnection()
+ * @see HttpStatus#SC_OK
+ */
+ protected boolean shouldCloseConnection() {
+ return (getStatusCode() != HttpStatus.SC_OK);
+ }
+
/** Log object for this class. */
private static final Log LOG = LogFactory.getLog(ConnectMethod.class);
/** The wrapped method */
private HttpMethod method;
+
}
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.119
diff -u -r1.119 HttpMethodBase.java
--- java/org/apache/commons/httpclient/HttpMethodBase.java 28 Feb 2003 12:48:58 -0000 1.119
+++ java/org/apache/commons/httpclient/HttpMethodBase.java 1 Mar 2003 16:58:23 -0000
@@ -808,15 +808,8 @@
*/
protected boolean shouldCloseConnection() {
if (!http11) {
- if (getName().equals(ConnectMethod.NAME)
- && (statusLine.getStatusCode() == HttpStatus.SC_OK)) {
- LOG.debug("Will leave connection open for tunneling");
- return false;
- } else {
- LOG.debug("Should close connection since using HTTP/1.0, "
- + "ConnectMethod and status is OK");
- return true;
- }
+ LOG.debug("Should close connection since using HTTP/1.0.");
+ return true;
} else {
Header connectionHeader = getResponseHeader("connection");
if (null != connectionHeader