Index: src/java/org/apache/nutch/fetcher/Fetcher.java
===================================================================
--- src/java/org/apache/nutch/fetcher/Fetcher.java	(revision 432325)
+++ src/java/org/apache/nutch/fetcher/Fetcher.java	(working copy)
@@ -194,6 +194,10 @@
                 datum.setRetriesSinceFetch(datum.getRetriesSinceFetch()+1);
                 output(url, datum, null, CrawlDatum.STATUS_FETCH_RETRY);
                 break;
+              case ProtocolStatus.BLOCKED:          
+                // was blocked http.max.delays times during fetching, try again next time
+                output(url, datum, null, CrawlDatum.STATUS_FETCH_RETRY);
+                break;
                 
               case ProtocolStatus.GONE:           // gone
               case ProtocolStatus.NOTFOUND:
Index: src/java/org/apache/nutch/protocol/ProtocolStatus.java
===================================================================
--- src/java/org/apache/nutch/protocol/ProtocolStatus.java	(revision 432325)
+++ src/java/org/apache/nutch/protocol/ProtocolStatus.java	(working copy)
@@ -64,6 +64,9 @@
    * The expected number of milliseconds to wait before retry may be provided
    * in args. */
   public static final int WOULDBLOCK           = 22;
+  /** Thread was blocked http.max.delays times during fetching. */
+  public static final int BLOCKED          = 23;
+
   
   // Useful static instances for status codes that don't usually require any
   // additional arguments.
@@ -77,6 +80,7 @@
   public static final ProtocolStatus STATUS_NOTFETCHING = new ProtocolStatus(NOTFETCHING);
   public static final ProtocolStatus STATUS_NOTMODIFIED = new ProtocolStatus(NOTMODIFIED);
   public static final ProtocolStatus STATUS_WOULDBLOCK = new ProtocolStatus(WOULDBLOCK);
+  public static final ProtocolStatus STATUS_BLOCKED = new ProtocolStatus(BLOCKED);
   
   private int code;
   private long lastModified;
@@ -99,6 +103,7 @@
     codeToName.put(new Integer(NOTFETCHING), "notfetching");
     codeToName.put(new Integer(NOTMODIFIED), "notmodified");
     codeToName.put(new Integer(WOULDBLOCK), "wouldblock");
+    codeToName.put(new Integer(BLOCKED), "blocked");
   }
   
   public ProtocolStatus() {
Index: src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/BlockedException.java
===================================================================
--- src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/BlockedException.java	(revision 0)
+++ src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/BlockedException.java	(revision 0)
@@ -0,0 +1,24 @@
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nutch.protocol.http.api;
+
+public class BlockedException extends HttpException {
+
+  public BlockedException(String msg) {
+    super(msg);
+  }
+
+}
Index: src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java
===================================================================
--- src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java	(revision 432325)
+++ src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java	(working copy)
@@ -197,7 +197,13 @@
                 null, null, this.conf);
         return new ProtocolOutput(c, ProtocolStatus.STATUS_WOULDBLOCK);
       }
-      String host = blockAddr(u, delay);
+      String host;
+      try {
+        host = blockAddr(u, delay);
+      } catch (BlockedException e) {
+        return new ProtocolOutput(null, ProtocolStatus.STATUS_BLOCKED);
+      }
+
       Response response;
       try {
         response = getResponse(u, datum, false); // make a request
@@ -354,7 +360,7 @@
       }
       
       if (delays == maxDelays)
-        throw new HttpException("Exceeded http.max.delays: retry later.");
+        throw new BlockedException("Exceeded http.max.delays: retry later.");
       
       long done = time.longValue();
       long now = System.currentTimeMillis();
