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 Bialecki7d32b16ae77d
diff --git a/CHANGES.txt b/CHANGES.txt
index 0d50bf95c..af0a05b54 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Release 2.0 - Current Development
+* NUTCH-962 max. redirects not handled correctly: fetcher stops at max-1 redirects (Sebastian Nagel via ab)
+
* NUTCH-964 Upgraded Xerces to 2.91 (markus)
* NUTCH-824 Crawling - File Error 404 when fetching file with an hexadecimal character in the file name (Michela Becchi via jnioche)
diff --git a/src/java/org/apache/nutch/fetcher/FetcherReducer.java b/src/java/org/apache/nutch/fetcher/FetcherReducer.java
index e125cc815..3fd8b5193 100644
--- a/src/java/org/apache/nutch/fetcher/FetcherReducer.java
+++ b/src/java/org/apache/nutch/fetcher/FetcherReducer.java
@@ -514,14 +514,14 @@ extends GoraReducer<IntWritable, FetchEntry, String, WebPage> {
output(fit, null, status, CrawlStatus.STATUS_RETRY);
}
- if (redirecting && redirectCount >= maxRedirect) {
+ if (redirecting && redirectCount > maxRedirect) {
fetchQueues.finishFetchItem(fit);
LOG.info(" - redirect count exceeded " + fit.url);
output(fit, null, ProtocolStatusUtils.STATUS_REDIR_EXCEEDED,
CrawlStatus.STATUS_GONE);
}
- } while (redirecting && (redirectCount < maxRedirect));
+ } while (redirecting && (redirectCount <= maxRedirect));
} catch (final Throwable t) { // unexpected exception
// unblock