Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-962 max. redirects not handled correctly: fetcher stops at max-1 redirects.

Andrzej Bialeckibb8625642df0
diff --git a/CHANGES.txt b/CHANGES.txt
index f09a49ff8..96d56771b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Release 1.3 - Current Development
+* NUTCH-962 max. redirects not handled correctly: fetcher stops at max-1 redirects (Sebastian Nagel via ab)
+
* NUTCH-921 Reduce dependency of Nutch on config files (ab)
* NUTCH-876 Remove remaining robots/IP blocking code in lib-http (ab)
diff --git a/src/java/org/apache/nutch/fetcher/Fetcher.java b/src/java/org/apache/nutch/fetcher/Fetcher.java
index f7f696c83..074cd6542 100644
--- a/src/java/org/apache/nutch/fetcher/Fetcher.java
+++ b/src/java/org/apache/nutch/fetcher/Fetcher.java
@@ -751,7 +751,7 @@ public class Fetcher extends Configured implements Tool,
output(fit.url, fit.datum, null, status, CrawlDatum.STATUS_FETCH_RETRY);
}
- if (redirecting && redirectCount >= maxRedirect) {
+ if (redirecting && redirectCount > maxRedirect) {
fetchQueues.finishFetchItem(fit);
if (LOG.isInfoEnabled()) {
LOG.info(" - redirect count exceeded " + fit.url);
@@ -759,7 +759,7 @@ public class Fetcher extends Configured implements Tool,
output(fit.url, fit.datum, null, ProtocolStatus.STATUS_REDIR_EXCEEDED, CrawlDatum.STATUS_FETCH_GONE);
}
- } while (redirecting && (redirectCount < maxRedirect));
+ } while (redirecting && (redirectCount <= maxRedirect));
} catch (Throwable t) { // unexpected exception
// unblock