You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by ab...@apache.org on 2006/04/05 19:01:04 UTC

svn commit: r391676 - /lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java

Author: ab
Date: Wed Apr  5 10:01:02 2006
New Revision: 391676

URL: http://svn.apache.org/viewcvs?rev=391676&view=rev
Log:
Fix protocol-level redirect code. Patch by Dennis Kubes.

Make it clear that this is a protocol-level redirect, as
opposed to a content-level redirect.

Modified:
    lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java

Modified: lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java?rev=391676&r1=391675&r2=391676&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java (original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java Wed Apr  5 10:01:02 2006
@@ -116,6 +116,7 @@
             lastRequestStart = System.currentTimeMillis();
           }
 
+          // url may be changed through redirects.
           String url = key.toString();
           try {
             LOG.info("fetching " + url);            // fetch the page
@@ -126,7 +127,7 @@
               redirecting = false;
               LOG.fine("redirectCount=" + redirectCount);
               Protocol protocol = this.protocolFactory.getProtocol(url);
-              ProtocolOutput output = protocol.getProtocolOutput(key, datum);
+              ProtocolOutput output = protocol.getProtocolOutput(new UTF8(url), datum);
               ProtocolStatus status = output.getStatus();
               Content content = output.getContent();
 
@@ -145,9 +146,9 @@
                   url = newUrl;
                   redirecting = true;
                   redirectCount++;
-                  LOG.fine(" - redirect to " + url);
+                  LOG.fine(" - protocol redirect to " + url);
                 } else {
-                  LOG.fine(" - redirect skipped: " +
+                  LOG.fine(" - protocol redirect skipped: " +
                            (url.equals(newUrl) ? "to same url" : "filtered"));
                 }
                 break;