From 8aa9fd8f24f90007fba26d686d01e4760d3f01c6 Mon Sep 17 00:00:00 2001 From: danielr Date: Thu, 10 Apr 2008 16:47:57 +0000 Subject: [PATCH] HTTPC with only 1 retry git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4677 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/JakartaCommonsHttpClient.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/de/anomic/http/JakartaCommonsHttpClient.java b/source/de/anomic/http/JakartaCommonsHttpClient.java index ae3901593..9d5de0e22 100644 --- a/source/de/anomic/http/JakartaCommonsHttpClient.java +++ b/source/de/anomic/http/JakartaCommonsHttpClient.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.commons.httpclient.ConnectMethod; +import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; @@ -77,6 +78,9 @@ public class JakartaCommonsHttpClient extends de.anomic.http.HttpClient { private final static HttpClient apacheHttpClient = new HttpClient(conManager); static { + /** + * set options for client + */ // set user-agent yacyVersion thisversion = yacyVersion.thisVersion(); apacheHttpClient.getParams().setParameter(HttpMethodParams.USER_AGENT, @@ -84,6 +88,9 @@ public class JakartaCommonsHttpClient extends de.anomic.http.HttpClient { " (www.yacy.net; " + de.anomic.http.HttpClient.getSystemOST() + ") " + getCurrentUserAgent().replace(';', ':')); // last ; must be before location (this is parsed) + // only one retry + apacheHttpClient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(1, false)); + /** * set options for connection manager */