diff -a -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/daemon/common/commonOptions.ml ./src/daemon/common/commonOptions.ml
--- ./src/daemon/common/commonOptions.ml	2006-02-26 17:23:55.000000000 +0100
+++ ./src/daemon/common/commonOptions.ml	2006-03-02 23:04:17.000000000 +0100
@@ -910,6 +910,14 @@
   This implies some bandwidth-cost (with 200 connections ~10-20%)"
     bool_option !BasicSocket.socket_keepalive
 
+let referers = define_option current_section ["referers"]
+    "Cookies send with a http request (used for .torrent files and web_infos)"
+    (list_option (tuple2_option (string_option, string_option))) [(".*suprnova.*", "http://www.suprnova.org/")]
+
+let cookies = define_option current_section ["cookies"]
+    "Cookies send with a http request (used for .torrent files and web_infos)"
+    (list_option (tuple2_option (string_option, list_option (tuple2_option (string_option, string_option))))) []
+
 let http_proxy_server = define_option current_section ["http_proxy_server"]
     "Direct HTTP queries to HTTP proxy" string_option ""
 let http_proxy_port = define_option current_section ["http_proxy_port"]
diff -a -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/daemon/common/commonWeb.ml ./src/daemon/common/commonWeb.ml
--- ./src/daemon/common/commonWeb.ml	2006-02-05 14:17:40.000000000 +0100
+++ ./src/daemon/common/commonWeb.ml	2006-03-02 23:07:03.000000000 +0100
@@ -50,6 +50,23 @@
       H.basic_request with
       H.req_url = Url.of_string url;
       H.req_proxy = !CommonOptions.http_proxy;
+      H.req_referer = (
+        let (rule_search,rule_value) =
+          try (List.find(fun (rule_search,rule_value) ->
+            Str.string_match (Str.regexp rule_search) url 0
+          ) !!referers )
+          with Not_found -> ("",url) in
+        Some (Url.of_string rule_value) );
+      H.req_headers = (try
+        let cookies = List.assoc url !!cookies in
+          [ ( "Cookie", List.fold_left (fun res (key, value) ->
+              if res = "" then
+                key ^ "=" ^ value
+              else
+                res ^ "; " ^ key ^ "=" ^ value
+          ) "" cookies
+        ) ]
+      with Not_found -> []);
       H.req_user_agent =
       Printf.sprintf "MLDonkey/%s" Autoconf.current_version;
       H.req_max_retry = 20;
diff -a -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/daemon/driver/driverCommands.ml ./src/daemon/driver/driverCommands.ml
--- ./src/daemon/driver/driverCommands.ml	2006-02-26 17:23:55.000000000 +0100
+++ ./src/daemon/driver/driverCommands.ml	2006-03-02 23:08:22.000000000 +0100
@@ -2768,6 +2768,23 @@
                 H.req_proxy = !CommonOptions.http_proxy;
                 H.req_request = H.HEAD;
 		H.req_max_retry = 10;
+                H.req_referer = (
+                  let (rule_search,rule_value) =
+                    try (List.find(fun (rule_search,rule_value) ->
+                            Str.string_match (Str.regexp rule_search) u.Url.server 0
+                        ) !!referers )
+                    with Not_found -> ("",u.Url.server) in
+                  Some (Url.of_string rule_value) );
+                H.req_headers = (try
+                  let cookies = List.assoc u.Url.server !!cookies in
+	          [ ( "Cookie", List.fold_left (fun res (key, value) ->
+                          if res = "" then
+                            key ^ "=" ^ value
+                          else
+                            res ^ "; " ^ key ^ "=" ^ value
+                      ) "" cookies
+                    ) ]
+                with Not_found -> []);
                 H.req_user_agent =
                        Printf.sprintf "MLDonkey/%s" Autoconf.current_version;
             } in
diff -a -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/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ./src/networks/bittorrent/bTInteractive.ml	2006-02-23 11:49:24.000000000 +0100
+++ ./src/networks/bittorrent/bTInteractive.ml	2006-03-02 23:06:01.000000000 +0100
@@ -651,15 +651,14 @@
             H.req_proxy = !CommonOptions.http_proxy;
             H.req_user_agent = get_user_agent ();
             H.req_referer = (
-              let referers = !!BTOptions.referers in
               let (rule_search,rule_value) =
                 try (List.find(fun (rule_search,rule_value) ->
                         Str.string_match (Str.regexp rule_search) real_url 0
-                    ) referers )
+                    ) !!referers )
                 with Not_found -> ("",real_url) in
               Some (Url.of_string rule_value) );
             H.req_headers = (try
-              let cookies = List.assoc u.Url.server !!BTOptions.cookies in
+              let cookies = List.assoc u.Url.server !!cookies in
               [ ( "Cookie", List.fold_left (fun res (key, value) ->
                       if res = "" then
                         key ^ "=" ^ value
diff -a -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/bittorrent/bTOptions.ml ./src/networks/bittorrent/bTOptions.ml
--- ./src/networks/bittorrent/bTOptions.ml	2006-01-01 20:25:42.000000000 +0100
+++ ./src/networks/bittorrent/bTOptions.ml	2006-03-02 22:58:08.000000000 +0100
@@ -118,14 +118,6 @@
 let client_timeout = define_option bittorrent_section ["client_timeout"]
   "Timeout on client connections" float_option 90.
 
-let cookies = define_option bittorrent_section ["cookies"]
-    "Cookies send with http request to get .torrent file"
-    (list_option (tuple2_option (string_option, list_option (tuple2_option (string_option, string_option))))) []
-
-let referers = define_option bittorrent_section ["referers"]
-    "Referer sent with http request to get .torrent file"
-    (list_option (tuple2_option (string_option, string_option))) [(".*suprnova.*", "http://www.suprnova.org/")]
-
 let user_agent = define_option bittorrent_section ["user_agent"]
     "User agent string (default = \"default\")"
     string_option "default"
