Author: oglueck Date: Tue Jul 19 03:14:55 2005 New Revision: 219639 URL: http://svn.apache.org/viewcvs?rev=219639&view=rev Log: Fixed: Do not retry if host is unreachable.
PR: 35642 Reviewed by: Oleg Kalnichevski Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=219639&r1=219638&r2=219639&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original) +++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Tue Jul 19 03:14:55 2005 @@ -1,3 +1,10 @@ + +Changes since Release Candidate 3: + + * 35642 - Do not retry if host is unreachable. This ensures a connection timeout + will be obeied. + Contributed by Ortwin Glück <oglueck at apache.org> + Release 3.0 Release Candidate 3 ------------------- Changes since Release Candidate 2: Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java?rev=219639&r1=219638&r2=219639&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java Tue Jul 19 03:14:55 2005 @@ -31,6 +31,7 @@ import java.io.IOException; import java.io.InterruptedIOException; +import java.net.NoRouteToHostException; import java.net.UnknownHostException; /** @@ -57,7 +58,9 @@ private boolean requestSentRetryEnabled; /** - * Default constructor + * Creates a new DefaultHttpMethodRetryHandler. + * @param retryCount the number of times a method will be retried + * @param requestSentRetryEnabled if true, methods that have successfully sent their request will be retried */ public DefaultHttpMethodRetryHandler(int retryCount, boolean requestSentRetryEnabled) { super(); @@ -66,7 +69,8 @@ } /** - * Default constructor + * Creates a new DefaultHttpMethodRetryHandler that retries up to 3 times + * but does not retry methods that have successfully sent their requests. */ public DefaultHttpMethodRetryHandler() { this(3, false); @@ -101,6 +105,10 @@ } if (exception instanceof UnknownHostException) { // Unknown host + return false; + } + if (exception instanceof NoRouteToHostException) { + // Host unreachable return false; } if (SSL_HANDSHAKE_EXCEPTION != null && SSL_HANDSHAKE_EXCEPTION.isInstance(exception)) { Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=219639&r1=219638&r2=219639&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java Tue Jul 19 03:14:55 2005 @@ -431,7 +431,7 @@ throw e; } if (LOG.isInfoEnabled()) { - LOG.info("I/O exception caught when processing request: " + LOG.info("I/O exception ("+ e.getClass().getName() +") caught when processing request: " + e.getMessage()); } if (LOG.isDebugEnabled()) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]