diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/daemon/driver/driverControlers.ml ./src/daemon/driver/driverControlers.ml
--- ./src/daemon/driver/driverControlers.ml	2006-07-20 13:07:03.000000000 +0200
+++ ./src/daemon/driver/driverControlers.ml	2006-07-21 18:18:37.000000000 +0200
@@ -958,7 +958,7 @@
   if not (valid_password user r.options.passwd) then begin
       clear_page buf;
       http_file_type := HTM;
-      Buffer.add_string buf (snd(Http_server.error_page "401" "" "" (Ip.to_string (TcpBufferedSocket.my_ip r.sock)) (string_of_int !!http_port)));
+      Buffer.add_string buf (snd(Http_server.error_page "401" "" "" (Ip.to_string (TcpBufferedSocket.my_ip r.sock)) (string_of_int !!http_port) None));
       need_auth r !!http_realm
     end
   else
@@ -1524,6 +1524,7 @@
       port = !!http_port;
       requests = [];
       addrs = !!allowed_ips;
+      use_ip_block_list = false;
       base_ref = "";
       default = http_handler http_options;
     } in
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/networks/bittorrent/bTTracker.ml ./src/networks/bittorrent/bTTracker.ml
--- ./src/networks/bittorrent/bTTracker.ml	2006-05-20 01:43:54.000000000 +0200
+++ ./src/networks/bittorrent/bTTracker.ml	2006-07-21 18:18:33.000000000 +0200
@@ -557,6 +557,7 @@
           requests = [];
           addrs = [ Ip.of_string "255.255.255.255" ];
           base_ref = "";
+	  use_ip_block_list = true;
           default = http_handler;
         } in
       let sock = TcpServerSocket.create "BT tracker"
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/utils/net/http_server.ml ./src/utils/net/http_server.ml
--- ./src/utils/net/http_server.ml	2006-07-20 13:02:52.000000000 +0200
+++ ./src/utils/net/http_server.ml	2006-07-21 18:18:24.000000000 +0200
@@ -92,6 +92,9 @@
 | Read_auth
 | Write_auth
 
+type error_reason =
+| Blocked
+| Not_allowed
 
 type header =
   Unknown of string * string
@@ -145,6 +148,7 @@
     mutable port : int;
     requests : (string * handler) list;
     mutable addrs : Ip.t list;
+    use_ip_block_list : bool;
     base_ref : string;
     default : handler;
   }
@@ -223,13 +227,17 @@
   in
   iter 0 []
 
-let error_page code from_ip from_port my_ip my_port =
+let error_page code from_ip from_port my_ip my_port reason =
   let error_text, error_text_long =
     match code with
     | "401" -> "Unauthorized", "<p>Please login using a valid username and password</p>"
-    | "403" -> "Forbidden", Printf.sprintf
+    | "403" -> "Forbidden", 
+		(match reason with
+		   Some Not_allowed -> Printf.sprintf
 "<p>Connection from %s rejected (see downloads.ini, <a href=\"http://mldonkey.sourceforge.net/Allowed_ips\">allowed_ips</a>)</p>\n"
-        from_ip
+				    from_ip
+		 | Some Blocked -> Printf.sprintf "IP %s is blocked, its part of the used IP blocklist " from_ip
+		 | None -> "")
     | _ -> Printf.sprintf "Unknown %s" code, ""
   in
   let reject_message = Printf.sprintf
@@ -822,13 +830,17 @@
     TcpServerSocket.CONNECTION (s, Unix.ADDR_INET(from_ip, from_port)) ->
     (* check here if ip is OK *)
       let from_ip = Ip.of_inet_addr from_ip in
-      if Ip.matches from_ip config.addrs &&
-        (match !Ip.banned from_ip with
-           None -> true
-         | Some reason ->
-             lprintf_nl "%s:%d blocked: %s\n"
-               (Ip.to_string from_ip) from_port reason;
-             false) then
+      let ip_is_allowed from_ip = Ip.matches from_ip config.addrs in
+      let ip_is_blocked from_ip =
+	if config.use_ip_block_list then
+	  match !Ip.banned from_ip with
+            None -> false
+           | Some reason -> lprintf_nl "%s:%d blocked: %s"
+               (Ip.to_string from_ip) from_port reason; true
+        else
+	  false
+      in 
+      if ip_is_allowed from_ip && not (ip_is_blocked from_ip) then
         let token = create_token unlimited_connection_manager in
         let sock = TcpBufferedSocket.create_simple
             token "http connection" s in
@@ -839,15 +851,18 @@
           (fun _ -> TcpBufferedSocket.close sock Closed_for_overflow;
          lprintf_nl "BUFFER OVERFLOW" );  ()
       else begin
-         lprintf_nl "connection from %s rejected (see allowed_ips setting)"
-          (Ip.to_string from_ip);
+        lprintf_nl "connection from %s rejected (%s)"
+          (Ip.to_string from_ip)
+	  (if ip_is_blocked from_ip then "IP is blocked" else "see allowed_ips setting");
         let token = create_token unlimited_connection_manager in
         let sock = TcpBufferedSocket.create_simple token "http connection" s in
 	let s1,s2 = error_page "403"
 	    (Ip.to_string from_ip)
 	    (string_of_int from_port)
 	    (Ip.to_string (TcpBufferedSocket.my_ip sock))
-	    (string_of_int config.port) in
+	    (string_of_int config.port)
+	    (if not (ip_is_allowed from_ip) then Some Not_allowed else Some Blocked)
+	in
 	TcpBufferedSocket.write_string sock (Printf.sprintf "%s\n%s" s1 s2);
         shutdown sock Closed_connect_failed;
         Unix.close s
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/utils/net/http_server.mli ./src/utils/net/http_server.mli
--- ./src/utils/net/http_server.mli	2006-07-20 13:02:52.000000000 +0200
+++ ./src/utils/net/http_server.mli	2006-07-21 18:18:28.000000000 +0200
@@ -17,6 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)
 type auth = No_auth | Read_auth | Write_auth
+type error_reason = Blocked | Not_allowed
 and header =
     Unknown of string * string
   | Referer of Url.url
@@ -60,6 +61,7 @@
     mutable port : int;
     requests : (string * handler) list;
     mutable addrs : Ip.t list;
+    use_ip_block_list : bool;
     base_ref : string;
     default : handler;
   } 
@@ -77,4 +79,4 @@
   
 val request_range : request -> int64 * (int64 option)
 val parse_range : string -> int64 * int64 option * int64 option
-val error_page : string -> string -> string -> string -> string -> string * string
+val error_page : string -> string -> string -> string -> string -> error_reason option -> string * string
