diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyClient.ml ./src/networks/donkey/donkeyClient.ml
--- ./src/networks/donkey/donkeyClient.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/donkey/donkeyClient.ml	2005-06-11 00:43:31.000000000 +0200
@@ -635,7 +635,7 @@
 
       | Field_UNKNOWN "emule_miscoptions1" ->
           for_int64_tag tag (fun i ->
-              DonkeyProtoClient.update_emule_proto_from_miscoptions1 
+              DonkeyProtoClient.update_emule_proto_from_miscoptions1
               c.client_emule_proto i)
       | Field_UNKNOWN "emule_version" ->
           for_int_tag tag (fun i ->
@@ -643,12 +643,12 @@
       | _ -> ()
   ) tags
     
-let update_emule_proto_from_tags c tags = 
-  List.iter (fun tag -> 
+let update_emule_proto_from_tags c tags =
+  List.iter (fun tag ->
       match tag.tag_name with
-        Field_UNKNOWN "compatibleclient" -> 
+        Field_UNKNOWN "compatibleclient" ->
           for_int_tag tag (fun i ->
-              match i with 
+              match i with
                 1 -> c.client_brand <- Brand_cdonkey
               | 2 -> c.client_brand <- Brand_lmule
               | 3 -> c.client_brand <- Brand_amule
@@ -658,33 +658,33 @@
               | 10 -> c.client_brand <- Brand_mldonkey3
               | 20 -> c.client_brand <- Brand_lphant
               | _ -> ()
-          )          
+          )
       | Field_UNKNOWN "compression" ->
-          for_int_tag tag (fun i -> 
+          for_int_tag tag (fun i ->
               c.client_emule_proto.emule_compression <- i)
       | Field_UNKNOWN "udpver" ->
-          for_int_tag tag (fun i -> 
-              c.client_emule_proto.emule_udpver <- i)          
+          for_int_tag tag (fun i ->
+              c.client_emule_proto.emule_udpver <- i)
       | Field_UNKNOWN "udpport" -> ()
       | Field_UNKNOWN "sourceexchange" ->
-          for_int_tag tag (fun i -> 
-              c.client_emule_proto.emule_sourceexchange <- i)          
+          for_int_tag tag (fun i ->
+              c.client_emule_proto.emule_sourceexchange <- i) 
       | Field_UNKNOWN "comments" ->
-          for_int_tag tag (fun i -> 
-              c.client_emule_proto.emule_comments <- i)          
+          for_int_tag tag (fun i ->
+              c.client_emule_proto.emule_comments <- i)
       | Field_UNKNOWN "extendedrequest" ->
-          for_int_tag tag (fun i -> 
-              c.client_emule_proto.emule_extendedrequest <- i)          
+          for_int_tag tag (fun i ->
+              c.client_emule_proto.emule_extendedrequest <- i)
       | Field_UNKNOWN "features" ->
-          for_int_tag tag (fun i -> 
-              c.client_emule_proto.emule_secident <- i land 0x3)          
+          for_int_tag tag (fun i ->
+              c.client_emule_proto.emule_secident <- i land 0x3)
       
       | _ -> 
           if !verbose_msg_clients then
             lprintf "Unknown Emule tag: [%s]\n" (escaped_string_of_field tag)
   ) tags
 
-let query_id ip port id =
+let rec query_id ip port id =
   let client_ip = client_ip None in
 
 (* TODO: check if we are connected to this server. If yes, issue a 
@@ -692,21 +692,22 @@
   if ip_reachable client_ip then
     let module Q = DonkeyProtoUdp.QueryCallUdp in
 (*    lprintf "Ask connection from indirect client\n"; *)
-    
-    let s = check_add_server ip port in
+
+    try
+      let s = DonkeyGlobals.find_server ip port in
     match s.server_sock with 
-      NoConnection | ConnectionWaiting _ ->
-        
-(* OK, this fixes the problem with Lugdunum servers, but there should be 
+      NoConnection | ConnectionWaiting _ -> ()
+
+(* OK, this fixes the problem with Lugdunum servers, but there should be
 another better way, since this functionnality is still useful... 
-  
+
   DonkeyProtoCom.udp_send (get_udp_sock ())
         ip (port+4)
         (DonkeyProtoUdp.QueryCallUdpReq {
             Q.ip = client_ip;
             Q.port = !!donkey_port;
             Q.id = id;
-          }) *) ()
+          }) *)
     | Connection sock ->
         printf_string "[QUERY ID]";
         server_send sock (
@@ -714,68 +715,14 @@
           let module C = M.QueryID in
           M.QueryIDReq id
         );
-(*                   Fifo.put s.server_id_requests file *)
         ()
-        
-        
-(* I think query_file was this saying from HighTime about:
-    Do not ask for all files if we don't know which files it
-    have. It's maybe like 3~4 times that i fix this bug and
-    it will be the last time : i won't submit another patch
-    if you don't apply this one. It's not only save some
-    bandwidth but also it should allow us to not be banned
-    by emule which don't like to receive lots of file
-    requests.
-let query_files c sock =  
-  
-  let s = c.client_source in
-  if s.DonkeySources.source_files = [] then begin
-      lprintf "Unknown Incoming clients\n";
-      List.iter (fun file ->
-          if file_state file = FileDownloading then begin
-              DonkeySources.set_request_result s file.file_sources
-                File_possible
-            end
-      ) !current_files;
-    end *) (* else
-    lprintf "Client has %d requests to emit\n" 
-      (List.length s.DonkeySources.source_files); *)
-    
-  (*
-  let nall_queries = ref 0 in
-  let nqueries = ref 0 in
-
-(*  lprintf "Client %d:\n" (client_num c);  *)
-  let files = ref [] in
-  (if c.client_source.DonkeySources.source_files = [] then begin
-(*        lprintf "  query all files\n";  *)
-        files := !current_files 
-      
-      end else
-      List.iter (fun r ->
-          if r.request_score > File_not_found then begin
-(*              lprintf "   query file %s\n" (file_best_name r.request_file); 
-               *)
-              files := r.request_file :: !files
-            end;
-      ) c.client_source.source_files);
+    with _ ->
+      if !!update_server_list_client then
+        begin
+          ignore(check_add_server ip port);
+          query_id ip port id
+        end
 
-(*
-  if !files = [] then begin
-      lprintf "   No queries to send !\n"; 
-    end;
-*)
-  
-  List.iter (fun file ->
-      incr nall_queries;
-      DonkeySources.query_file c file)
-  !files;
-  if !nqueries > 0 then
-    c.client_last_filereqs <- last_time ();
-  if !verbose then begin
-      lprintf "sent %d/%d file queries\n" !nqueries !nall_queries;
-    end
-*)
 
 external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
 let hash x = hash_param 10 100 x
@@ -1002,7 +949,7 @@
       
       begin
         match t.CR.server_info with
-          Some (ip, port) -> safe_add_server ip port
+          Some (ip, port) -> if !!update_server_list_client then safe_add_server ip port
         | _ -> ()
       end;
       
@@ -1984,7 +1931,7 @@
       
       begin
         match t.CR.server_info with
-          Some (ip, port) ->  safe_add_server ip port
+          Some (ip, port) ->  if !!update_server_list_client then safe_add_server ip port
         | None -> 
             if overnet then begin
                 lprintf "incoming Overnet client\n"; 
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyComplexOptions.ml ./src/networks/donkey/donkeyComplexOptions.ml
--- ./src/networks/donkey/donkeyComplexOptions.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/donkey/donkeyComplexOptions.ml	2005-06-11 00:23:36.000000000 +0200
@@ -605,15 +605,13 @@
       s        
       
 let check_add_server ip port =
-  if !!update_server_list &&
-    Ip.valid ip && Ip.reachable ip &&
+  if Ip.valid ip && Ip.reachable ip &&
     not (is_black_address ip port) && port <> 4662 then
     force_add_server ip port
   else raise Not_found
 
 let safe_add_server ip port =
-  if !!update_server_list &&
-    Ip.valid ip && Ip.reachable ip &&
+  if Ip.valid ip && Ip.reachable ip &&
     not (is_black_address ip port) && port <> 4662 then
     try
       ignore (DonkeyGlobals.find_server ip port)
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyInteractive.ml ./src/networks/donkey/donkeyInteractive.ml
--- ./src/networks/donkey/donkeyInteractive.ml	2005-05-28 13:19:42.000000000 +0200
+++ ./src/networks/donkey/donkeyInteractive.ml	2005-06-11 00:23:28.000000000 +0200
@@ -87,6 +87,7 @@
   
   
 let load_server_met filename =
+  if !!update_server_list_server then
   try
     let module S = DonkeyImport.Server in
     let s = File.to_string filename in
@@ -109,6 +110,7 @@
       lprintf "Exception %s while loading %s\n" (Printexc2.to_string e)
       filename;
       0
+  else 0
 
 let already_done = Failure "File already downloaded (use 'force_download' if necessary)"
       
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyOptions.ml ./src/networks/donkey/donkeyOptions.ml
--- ./src/networks/donkey/donkeyOptions.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/donkey/donkeyOptions.ml	2005-06-11 00:01:31.000000000 +0200
@@ -100,9 +100,13 @@
     "send all clients your IP regardless of what ID was assigned by the server"
     bool_option false
 
-let update_server_list = define_option donkey_section
-    ["update_server_list"] "Set this option to false if you don't want auto
-    update of servers list" bool_option true
+let update_server_list_server = define_option donkey_section
+    ["update_server_list_server"] "Set this option to false if you don't want to
+    receive new servers from servers" bool_option true
+
+let update_server_list_client = define_option donkey_section
+    ["update_server_list_client"] "Set this option to false if you don't want to
+    receive new servers from clients" bool_option false
 
 let keep_best_server = define_expert_option donkey_section
     ["keep_best_server"] "Set this option to false if you don't want mldonkey
@@ -302,7 +306,8 @@
 (*    "Maximal Source Age", shortname max_sources_age, "T"; *)
     "Maximal Server Age", shortname max_server_age, "T";
     "Min Left Servers After Clean", shortname min_left_servers, "T";
-    "Update Server List", shortname update_server_list, "B";
+    "Update Server List Server", shortname update_server_list_server, "B";
+    "Update Server List Client", shortname update_server_list_client, "B";
     "Servers Walking Period", shortname servers_walking_period, "T";
     "Force High ID", shortname force_high_id, "B";
     "Max Number of Connected Servers", shortname max_connected_servers, "T";
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyOvernet.ml ./src/networks/donkey/donkeyOvernet.ml
--- ./src/networks/donkey/donkeyOvernet.ml	2005-05-13 23:15:47.000000000 +0200
+++ ./src/networks/donkey/donkeyOvernet.ml	2005-06-11 00:01:31.000000000 +0200
@@ -448,6 +448,11 @@
   [Proto.options_section_name; "md4"]
   "The MD4 of the Overnet client" Md4.option (Md4.random ())
 
+let overnet_update_nodes = define_option overnet_section
+  [Proto.options_section_name; "update_nodes"]
+  "Set this option to false if you don't want to receive new Overnet peers"
+    bool_option true
+
 let gui_overnet_options_panel = 
   (*
   define_option overnet_section ["gui_overnet_options_panel"]
@@ -768,8 +773,8 @@
   p.peer_last_send <- last_time ();
   udp_send_direct p.peer_ip p.peer_port msg
 
-let bootstrap ip port = 
-  if Ip.valid ip && Ip.reachable ip && port <> 0 then begin
+let bootstrap ip port =
+  if !!overnet_update_nodes && Ip.valid ip && Ip.reachable ip && port <> 0 then begin
       LimitedList.add !!boot_peers (ip,port);
       boot_peers_copy := (ip,port) :: !boot_peers_copy
     end
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyServers.ml ./src/networks/donkey/donkeyServers.ml
--- ./src/networks/donkey/donkeyServers.ml	2005-06-06 23:23:11.000000000 +0200
+++ ./src/networks/donkey/donkeyServers.ml	2005-06-11 00:01:31.000000000 +0200
@@ -295,7 +295,7 @@
   
   | M.ServerListReq l ->
       if !verbose then lprintf "donkeyServers: Received serverlist\n";
-      if !!update_server_list then
+      if !!update_server_list_server then
         let module Q = M.ServerList in
         List.iter (fun s ->
             safe_add_server s.Q.ip s.Q.port
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyUdp.ml ./src/networks/donkey/donkeyUdp.ml
--- ./src/networks/donkey/donkeyUdp.ml	2005-04-24 21:44:16.000000000 +0200
+++ ./src/networks/donkey/donkeyUdp.ml	2005-06-11 00:01:31.000000000 +0200
@@ -226,7 +226,7 @@
     match p.UdpSocket.udp_addr with
       | Unix.ADDR_INET(ip, port) ->
           let ip = Ip.of_inet_addr ip in
-          if !!update_server_list then
+          if !!update_server_list_server then
             let s = check_add_server ip (port-4) in
             (* set last_conn, but add a 2 minutes offset to prevent 
                staying connected to this server *)
