Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-419 Unavailable robots.txt kills fetch.

Andrzej Bialeckiad1883440edc
diff --git a/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java b/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java
index 63615036c..d72f5f872 100644
--- a/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java
+++ b/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java
@@ -176,6 +176,10 @@ public class Http extends HttpBase {
params.setDefaultMaxConnectionsPerHost(maxThreadsTotal);
}
+ // executeMethod(HttpMethod) seems to ignore the connection timeout on the connection manager.
+ // set it explicitly on the HttpClient.
+ client.getParams().setConnectionManagerTimeout(timeout);
+
HostConfiguration hostConf = client.getHostConfiguration();
ArrayList headers = new ArrayList();
// Set the User Agent in the header