You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by og...@apache.org on 2005/07/19 12:14:56 UTC
svn commit: r219639 - in /jakarta/commons/proper/httpclient/trunk:
release_notes.txt
src/java/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.java
src/java/org/apache/commons/httpclient/HttpMethodDirector.java
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org