Index: java/org/apache/commons/httpclient/HttpConnection.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v retrieving revision 1.74 diff -u -r1.74 HttpConnection.java --- java/org/apache/commons/httpclient/HttpConnection.java 8 Sep 2003 00:37:29 -0000 1.74 +++ java/org/apache/commons/httpclient/HttpConnection.java 9 Sep 2003 02:38:44 -0000 @@ -804,7 +804,14 @@ LOG.debug("Input data not available after " + timeout + " ms"); } } finally { - socket.setSoTimeout(soTimeout); + try { + socket.setSoTimeout(soTimeout); + } catch (IOException ioe) { + LOG.debug("An error ocurred while resetting soTimeout, we will assume that" + + " no response is available.", + ioe); + result = false; + } } } return result; Index: java/org/apache/commons/httpclient/methods/HeadMethod.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java,v retrieving revision 1.23 diff -u -r1.23 HeadMethod.java --- java/org/apache/commons/httpclient/methods/HeadMethod.java 9 Aug 2003 19:37:58 -0000 1.23 +++ java/org/apache/commons/httpclient/methods/HeadMethod.java 9 Sep 2003 02:38:45 -0000 @@ -68,8 +68,8 @@ import org.apache.commons.httpclient.HttpConnection; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpMethodBase; -import org.apache.commons.httpclient.ProtocolException; import org.apache.commons.httpclient.HttpState; +import org.apache.commons.httpclient.ProtocolException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -188,7 +188,16 @@ LOG.debug("Check for non-compliant response body. Timeout in " + this.bodyCheckTimeout + " ms"); } - if (conn.isResponseAvailable(this.bodyCheckTimeout)) { + boolean responseAvailable = false; + try { + responseAvailable = conn.isResponseAvailable(this.bodyCheckTimeout); + } catch (IOException e) { + LOG.debug("An IOException occurred while testing if a response was available," + + " we will assume one is not.", + e); + responseAvailable = false; + } + if (responseAvailable) { if (isStrictMode()) { throw new ProtocolException( "Body content may not be sent in response to HTTP HEAD request");