Author: ab
Date: Wed Mar  9 12:01:55 2011
New Revision: 1079765

URL: http://svn.apache.org/viewvc?rev=1079765&view=rev
Log:
NUTCH-962 max. redirects not handled correctly: fetcher stops at max-1 
redirects.

Modified:
    nutch/branches/branch-1.3/CHANGES.txt
    nutch/branches/branch-1.3/src/java/org/apache/nutch/fetcher/Fetcher.java

Modified: nutch/branches/branch-1.3/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/nutch/branches/branch-1.3/CHANGES.txt?rev=1079765&r1=1079764&r2=1079765&view=diff
==============================================================================
--- nutch/branches/branch-1.3/CHANGES.txt (original)
+++ nutch/branches/branch-1.3/CHANGES.txt Wed Mar  9 12:01:55 2011
@@ -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)

Modified: 
nutch/branches/branch-1.3/src/java/org/apache/nutch/fetcher/Fetcher.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/branch-1.3/src/java/org/apache/nutch/fetcher/Fetcher.java?rev=1079765&r1=1079764&r2=1079765&view=diff
==============================================================================
--- nutch/branches/branch-1.3/src/java/org/apache/nutch/fetcher/Fetcher.java 
(original)
+++ nutch/branches/branch-1.3/src/java/org/apache/nutch/fetcher/Fetcher.java 
Wed Mar  9 12:01:55 2011
@@ -751,7 +751,7 @@ public class Fetcher extends Configured 
                 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 
                 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


Reply via email to