Index: src/networks/donkey/donkeyClient.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/networks/donkey/donkeyClient.ml,v
retrieving revision 1.54
diff -u -3 -p -r1.54 donkeyClient.ml
--- src/networks/donkey/donkeyClient.ml	22 Jul 2005 14:32:12 -0000	1.54
+++ src/networks/donkey/donkeyClient.ml	26 Jul 2005 20:20:11 -0000
@@ -21,6 +21,7 @@ functions are defined in downloadOneFile
 
 open Printf2
 open Md4
+open Ip_set
 
 open CommonSources
 open CommonDownloads  
@@ -2199,8 +2200,15 @@ let client_connection_handler overnet t 
 (*  lprintf "[REMOTE CONN]\n"; *)
   match event with
     TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) ->
-
-      if can_open_indirect_connection () then
+      let from_ip = (Ip.of_inet_addr from_ip) in
+      if can_open_indirect_connection () &&
+        (match Ip_set.match_ip !Ip_set.bl from_ip with
+                   None -> true
+                 | Some br ->
+                     if !verbose_connect then
+                       lprintf "DKOV: %s:%d blocked: %s\n"
+                         (Ip.to_string from_ip) from_port br.blocking_description;
+                     false) then
         begin
 (*          lprintf "+++++++++++++++++++++++++++++++++++++++++++++++\n"; *)
           (try
@@ -2213,7 +2221,7 @@ let client_connection_handler overnet t 
                   (client_handler2 c) 
 (*client_msg_to_string*)
               in
-              init_connection sock (Ip.of_inet_addr from_ip);
+              init_connection sock from_ip;
               accept_connection_bandwidth sock;
               
 (* Normal connections have 20 minutes to live (AvailableSlot, QueryBloc
Index: src/networks/donkey/donkeyOvernet.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/networks/donkey/donkeyOvernet.ml,v
retrieving revision 1.39
diff -u -3 -p -r1.39 donkeyOvernet.ml
--- src/networks/donkey/donkeyOvernet.ml	22 Jul 2005 10:58:55 -0000	1.39
+++ src/networks/donkey/donkeyOvernet.ml	26 Jul 2005 20:20:12 -0000
@@ -196,6 +196,12 @@ let message_to_string t =
         List.iter (print_peer buf) peers
     | OvernetPublished target ->
         Printf.bprintf buf "OvernetPublished %s\n" (Md4.to_string target)
+    | OvernetPeerNotFound p ->
+        Printf.bprintf buf "OvernetPeerNotFound\n";
+        print_peer buf p
+    | OvernetUnknown21 p ->
+        Printf.bprintf buf "OvernetUnknown21\n";
+        print_peer buf p
     | _ ->
         Buffer.add_string buf "unknown\n"
   end;
@@ -1072,6 +1078,50 @@ let udp_client_handler t p =
         | _ -> ()
       end
 
+  | OvernetFirewallConnectionACK(md4) ->   
+       if !verbose_overnet && debug_client other_ip then   
+         lprintf_nl () "FIREWALL ACK for md4=%s" (Md4.to_string md4)   
+    
+   | OvernetFirewallConnectionNACK(md4) ->   
+       if !verbose_overnet && debug_client other_ip then   
+         lprintf_nl () "FIREWALL NACK for md4=%s" (Md4.to_string md4)   
+    
+ (* send the answer *)   
+   | OvernetGetMyIP other_port ->   
+       if !verbose_overnet && debug_client other_ip then   
+         lprintf_nl () "GET MY IP (port=%d)\n" other_port;   
+ (* FIXME : should be able to flush the UDP buffer*)   
+       udp_send_direct other_ip other_port (OvernetGetMyIPResult other_ip);   
+       udp_send_direct other_ip other_port OvernetGetMyIPDone   
+    
+   | OvernetGetMyIPResult(ip) ->   
+       if !verbose_overnet && debug_client other_ip then   
+         lprintf_nl () "GET MY IP RESULT (%s)\n" (Ip.to_string ip)   
+    
+   | OvernetGetMyIPDone ->   
+       if !verbose_overnet && debug_client other_ip then   
+         lprintf_nl () "GET MY IP DONE\n"   
+  
+  | OvernetPeerNotFound peer ->
+      begin
+        if !verbose_overnet && debug_client other_ip then
+          lprintf_nl () "Peer NOT FOUND %s (%s:%d) kind: %d (msg 33)"
+            (Md4.to_string peer.peer_md4) (Ip.to_string peer.peer_ip)
+        peer.peer_port peer.peer_kind;
+        let key = (peer.peer_ip, peer.peer_port) in
+        if Hashtbl.mem known_peers key
+        then begin
+            Hashtbl.remove known_peers key;
+          end
+      end
+
+   | OvernetUnknown21 peer ->
+      if !verbose_overnet && debug_client other_ip then begin
+          lprintf_nl () "Unknown 21 message ...";
+          lprintf_nl () "From peer: %s ip: %s:%d kind: %d"
+            (Md4.to_string peer.peer_md4) (Ip.to_string peer.peer_ip) peer.peer_port peer.peer_kind
+        end
+
   | _ -> failwith "Message not understood"
 
 let query_next_peers () =
