HTTPC with only 1 retry

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4677 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
danielr 17 years ago
parent 444dce7e81
commit 8aa9fd8f24

@ -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
*/

Loading…
Cancel
Save