mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Mon, 28 Aug 2006 18:20:19 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/08/28 18:20:18

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonFile.ml commonFile.mli 
                           commonInteractive.ml 
        src/daemon/driver: driverCommands.ml driverInteractive.ml 
        src/networks/donkey: donkeyInteractive.ml 

Log message:
        patch #5334

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.977&r2=1.978
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.ml?cvsroot=mldonkey&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.mli?cvsroot=mldonkey&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonInteractive.ml?cvsroot=mldonkey&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverCommands.ml?cvsroot=mldonkey&r1=1.165&r2=1.166
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInteractive.ml?cvsroot=mldonkey&r1=1.93&r2=1.94
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyInteractive.ml?cvsroot=mldonkey&r1=1.117&r2=1.118

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.977
retrieving revision 1.978
diff -u -b -r1.977 -r1.978
--- distrib/ChangeLog   28 Aug 2006 18:19:15 -0000      1.977
+++ distrib/ChangeLog   28 Aug 2006 18:20:18 -0000      1.978
@@ -15,6 +15,7 @@
 =========
 
 2006/08/28
+5334: HTML: Display edk2 links in search results
 5333: Clean logging (Swarmer, Fasttrack, Gnutella)
 5332: New command option: rem blocked - remove all IP blocked servers
 5330: Configure: Check MinGW version, at least 3.10 is needed (Schlumpf)

Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- src/daemon/common/commonFile.ml     10 Aug 2006 17:41:19 -0000      1.57
+++ src/daemon/common/commonFile.ml     28 Aug 2006 18:20:18 -0000      1.58
@@ -697,6 +697,11 @@
     
     with _ -> ())
 
+let file_print_ed2k_link filename filesize md4hash =
+  if md4hash = Md4.null then "" else
+  Printf.sprintf "ed2k://|file|%s|%s|%s|/"
+    (Url.encode filename) (Int64.to_string filesize) (Md4.to_string md4hash)
+
 (*************************************************************************)
 (*                                                                       *)
 (*                         add_segment (internal)                        *)

Index: src/daemon/common/commonFile.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.mli,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- src/daemon/common/commonFile.mli    20 Jul 2006 15:30:21 -0000      1.17
+++ src/daemon/common/commonFile.mli    28 Aug 2006 18:20:18 -0000      1.18
@@ -104,6 +104,7 @@
 val file_downloaders : CommonTypes.file -> CommonTypes.ui_conn -> int -> bool
 val colored_chunks : VerificationBitmap.t -> string
 val file_print : CommonTypes.file -> CommonTypes.ui_conn -> unit
+val file_print_ed2k_link : string -> int64 -> Md4.Md4.t -> string
 val file_size : CommonTypes.file -> int64
 val file_disk_name : CommonTypes.file -> string
 val file_fd : CommonTypes.file -> Unix32.t

Index: src/daemon/common/commonInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonInteractive.ml,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- src/daemon/common/commonInteractive.ml      4 Aug 2006 20:10:39 -0000       
1.77
+++ src/daemon/common/commonInteractive.ml      28 Aug 2006 18:20:18 -0000      
1.78
@@ -164,13 +164,6 @@
   in
   let network = network_find_by_num info.G.file_network in
   let filename = Filename.basename new_name in
-  let ed2k_hash =
-    if info.G.file_md4 = Md4.null then "" else
-       Printf.sprintf "ed2k://|file|%s|%s|%s|/"
-        (Url.encode filename)
-        (Int64.to_string (file_size file))
-        (Md4.to_string info.G.file_md4)
-  in
   begin try
   MlUnix.fork_and_exec !!file_completed_cmd
       [|  (* keep those for compatibility *)
@@ -188,7 +181,7 @@
            ("DLFILES",   string_of_int (List.length !!files)); 
            ("INCOMING",  incoming);
            ("NETWORK",   network.network_name);
-           ("ED2K_HASH", ed2k_hash)]
+           ("ED2K_HASH", (file_print_ed2k_link filename (file_size file) 
info.G.file_md4))]
   with e -> 
       lprintf_nl "Exception %s while executing %s"
         (Printexc2.to_string e) !!file_completed_cmd

Index: src/daemon/driver/driverCommands.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -b -r1.165 -r1.166
--- src/daemon/driver/driverCommands.ml 28 Aug 2006 18:17:47 -0000      1.165
+++ src/daemon/driver/driverCommands.ml 28 Aug 2006 18:20:18 -0000      1.166
@@ -2197,10 +2197,9 @@
               begin
                 incr counter;
 
-                let ed2k = Printf.sprintf "ed2k://|file|%s|%s|%s|/"
-                    (Url.encode (Filename.basename impl.impl_shared_codedname))
-                  (Int64.to_string impl.impl_shared_size)
-                  (Md4.to_string impl.impl_shared_id) in
+                let ed2k = file_print_ed2k_link
+                    (Filename.basename impl.impl_shared_codedname)
+                  impl.impl_shared_size impl.impl_shared_id in
 
                 Printf.bprintf buf "\\<tr class=\\\"%s\\\""
                   (if (!counter mod 2 == 0) then "dl-1" else "dl-2";);
@@ -2272,10 +2271,9 @@
 
         List.iter (fun impl ->
           if (impl.impl_shared_id <> Md4.null) then
-           Printf.bprintf buf "ed2k://|file|%s|%s|%s|/\n"
-              (Url.encode (Filename.basename impl.impl_shared_codedname))
-              (Int64.to_string impl.impl_shared_size)
-              (Md4.to_string impl.impl_shared_id);
+           Printf.bprintf buf "%s\n" (file_print_ed2k_link
+             (Filename.basename impl.impl_shared_codedname)
+             impl.impl_shared_size impl.impl_shared_id);
         ) list;
         "Done"
     ), ":\t\t\t\t\tlist links of shared files";

Index: src/daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -b -r1.93 -r1.94
--- src/daemon/driver/driverInteractive.ml      12 Aug 2006 20:36:14 -0000      
1.93
+++ src/daemon/driver/driverInteractive.ml      28 Aug 2006 18:20:18 -0000      
1.94
@@ -1172,7 +1172,19 @@
               in
               
                 if use_html_mods o 
-                  then Printf.bprintf buf "\\<td 
class=\\\"sr\\\"\\>%s\\</td\\>" network_name
+                  then Printf.bprintf buf "\\<td 
class=\\\"sr\\\"\\>%s\\</td\\>"
+                  (let rec iter uids =
+                     match uids with
+                       [] -> network_name
+                     | uid :: tail ->
+                         match Uid.to_uid uid with
+                           Ed2k md4 ->
+                             Printf.sprintf "\\<a href=\\\"%s\\\"\\>%s\\</a\\>"
+                               (file_print_ed2k_link (List.hd r.result_names) 
r.result_size md4)
+                               network_name
+                           | _  -> iter tail
+                   in
+                   iter r.result_uids)
                   else Printf.bprintf  buf "[%5d] %s " !counter network_name;
 
               if o.conn_output = HTML then begin

Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- src/networks/donkey/donkeyInteractive.ml    16 Aug 2006 19:12:10 -0000      
1.117
+++ src/networks/donkey/donkeyInteractive.ml    28 Aug 2006 18:20:18 -0000      
1.118
@@ -1240,16 +1240,10 @@
        )
        ];
       tr ();
+      let ed2k = file_print_ed2k_link (file_best_name file) (file_size file) 
file.file_md4 in
       html_mods_td buf [
         ("ed2k link", "sr br", "ed2k link");
-        ("", "sr", Printf.sprintf "\\<a 
href=\\\"ed2k://|file|%s|%s|%s|/\\\"\\>ed2k://|file|%s|%s|%s|/\\</A\\>"
-            (Url.encode (file_best_name file))
-          (Int64.to_string (file_size file))
-          (Md4.to_string file.file_md4)
-          (file_best_name file)
-          (Int64.to_string (file_size file))
-          (Md4.to_string file.file_md4)) ];
-
+        ("", "sr", Printf.sprintf "\\<a href=\\\"%s\\\"\\>%s\\</A\\>" ed2k 
ed2k) ];
       tr ();
       let optionlist = ref "" in
       List.iter (fun (name,_) ->
@@ -1456,10 +1450,7 @@
       DonkeyProtoKademlia.Kademlia.cancel_recover_file file;
   );
   file_ops.op_file_comment <- (fun file ->
-      Printf.sprintf "ed2k://|file|%s|%Ld|%s|"
-        (Url.encode (file_best_name file))
-      (file_size file)
-      (Md4.to_string file.file_md4)
+      file_print_ed2k_link (file_best_name file) (file_size file) file.file_md4
   );
   file_ops.op_file_files <- (fun file impl ->
       match file.file_swarmer with




reply via email to

[Prev in Thread] Current Thread [Next in Thread]