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: Thu, 12 Apr 2007 10:03:37 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       07/04/12 10:03:37

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonTypes.ml 
        src/daemon/driver: driverInterface.ml 
        src/networks/bittorrent: bTInteractive.ml 

Log message:
        patch #5862

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1229&r2=1.1230
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonTypes.ml?cvsroot=mldonkey&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInterface.ml?cvsroot=mldonkey&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTInteractive.ml?cvsroot=mldonkey&r1=1.133&r2=1.134

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1229
retrieving revision 1.1230
diff -u -b -r1.1229 -r1.1230
--- distrib/ChangeLog   12 Apr 2007 10:02:57 -0000      1.1229
+++ distrib/ChangeLog   12 Apr 2007 10:03:37 -0000      1.1230
@@ -15,6 +15,7 @@
 =========
 
 2007/04/12
+5862: BT: Informative GUI console messages after sending a .torrent file to GUI
 5859: HTML: Support sending files from $MLDONKEY_DIR/html_themes/
 
 2007/04/10

Index: src/daemon/common/commonTypes.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonTypes.ml,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- src/daemon/common/commonTypes.ml    6 Mar 2007 19:31:26 -0000       1.68
+++ src/daemon/common/commonTypes.ml    12 Apr 2007 10:03:37 -0000      1.69
@@ -88,8 +88,9 @@
   string_of_uid_sep uid "_"
 
 exception Illegal_urn of string
-exception Torrent_already_exists
-exception Torrent_can_not_be_used
+exception Torrent_started of string
+exception Torrent_already_exists of string
+exception Torrent_can_not_be_used of string
 
 let uid_of_string s =
   let s = String.lowercase s in

Index: src/daemon/driver/driverInterface.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInterface.ml,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- src/daemon/driver/driverInterface.ml        25 Jan 2007 13:29:05 -0000      
1.63
+++ src/daemon/driver/driverInterface.ml        12 Apr 2007 10:03:37 -0000      
1.64
@@ -1105,10 +1105,12 @@
   with 
     Failure s ->
       gui_send gui (Console (Printf.sprintf "Failure: %s\n" s))
-  | Torrent_can_not_be_used ->
-      gui_send gui (Console (Printf.sprintf "\nError: This torrent does not 
have valid tracker URLs\n"))
-  | Torrent_already_exists ->
-      gui_send gui (Console (Printf.sprintf "\nError: This torrent is already 
in download queue\n"))
+  | Torrent_started s ->
+      gui_send gui (Console (Printf.sprintf "\nInfo: Torrent %s started\n" s))
+  | Torrent_can_not_be_used s ->
+      gui_send gui (Console (Printf.sprintf "\nError: Torrent %s does not have 
valid tracker URLs\n" s))
+  | Torrent_already_exists s ->
+      gui_send gui (Console (Printf.sprintf "\nError: Torrent %s is already in 
download queue\n" s))
   | e ->
       gui_send gui (Console (Printf.sprintf "from_gui: exception %s for 
message %s\n"
        (Printexc2.to_string e) (GuiProto.string_of_from_gui t)))

Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -b -r1.133 -r1.134
--- src/networks/bittorrent/bTInteractive.ml    3 Apr 2007 19:41:26 -0000       
1.133
+++ src/networks/bittorrent/bTInteractive.ml    12 Apr 2007 10:03:37 -0000      
1.134
@@ -640,7 +640,7 @@
     String2.check_prefix url "http://"; in
   List.iter (fun url -> if can_handle_tracker url then torrent_is_usable := 
true)
     (if torrent.torrent_announce_list <> [] then torrent.torrent_announce_list 
else [torrent.torrent_announce]);
-  if not !torrent_is_usable then raise Torrent_can_not_be_used;
+  if not !torrent_is_usable then raise (Torrent_can_not_be_used 
torrent.torrent_name);
 
   let torrent_diskname =
     let fs = Unix32.filesystem downloads_directory in
@@ -654,7 +654,7 @@
   if Sys.file_exists torrent_diskname then
     begin
       if !verbose then lprintf_nl "load_torrent_string: %s already exists, 
ignoring" torrent_diskname;
-      raise Torrent_already_exists
+      raise (Torrent_already_exists torrent.torrent_name)
     end;
   File.from_string torrent_diskname s;
 
@@ -804,7 +804,7 @@
       load_torrent_file file (try CommonUserDb.user2_user_find user with 
Not_found -> CommonUserDb.admin_user);
       (try Sys.remove file with _ -> ())
     with 
-      Torrent_can_not_be_used ->
+      Torrent_can_not_be_used _ ->
        Unix2.rename file (Filename.concat old_directory file_basename);
        lprintf_nl "Torrent %s does not have valid tracker URLs, moved to 
torrents/old ..." file_basename
     | e ->
@@ -888,8 +888,8 @@
             load_torrent_file url user;
             "", true
           with
-           Torrent_already_exists -> "A torrent with this name is already in 
the download queue", false
-         | Torrent_can_not_be_used -> "This torrent does not have valid 
tracker URLs", false
+           Torrent_already_exists _ -> "A torrent with this name is already in 
the download queue", false
+         | Torrent_can_not_be_used _ -> "This torrent does not have valid 
tracker URLs", false
         with e ->
           lprintf_nl "Exception %s while 2nd loading" (Printexc2.to_string e);
          let s = Printf.sprintf "Can not load load torrent file: %s"
@@ -1213,10 +1213,11 @@
       let text = String.sub s 2 (String.length s - 2) in
       if !verbose then lprintf_nl "received torrent from gui...";
       (try
-        ignore (load_torrent_string text user)
+        let file = load_torrent_string text user in
+        raise (Torrent_started file.file_name)
       with e -> (match e with
-         Torrent_can_not_be_used -> lprintf_nl "Loading torrent from GUI: this 
torrent can not be used"
-       | Torrent_already_exists -> lprintf_nl "Loading torrent from GUI: this 
torrent is already in download queue"
+       | Torrent_can_not_be_used s -> lprintf_nl "Loading torrent from GUI: 
torrent %s can not be used" s
+       | Torrent_already_exists s -> lprintf_nl "Loading torrent from GUI: 
torrent %s is already in download queue" s
        | _ -> ());
        raise e)
   | 1 -> (* 34+ *)




reply via email to

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