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/driver/dr...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/driver/dr...
Date: Fri, 06 Oct 2006 15:57:18 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/10/06 15:57:18

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

Log message:
        patch #5442

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1041&r2=1.1042
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInterface.ml?cvsroot=mldonkey&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTInteractive.ml?cvsroot=mldonkey&r1=1.114&r2=1.115

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1041
retrieving revision 1.1042
diff -u -b -r1.1041 -r1.1042
--- distrib/ChangeLog   6 Oct 2006 15:56:19 -0000       1.1041
+++ distrib/ChangeLog   6 Oct 2006 15:57:18 -0000       1.1042
@@ -15,6 +15,8 @@
 =========
 
 2006/10/06
+5442: BT: Verbose error messages when torrent is sent from GUI,
+      BT-multiuser: Protect command seeded_torrents
 5441: BT: Re-enable all trackers when file is resumed
 5440: HTML: Strip CR from multiline dllink input to fix FileTP filenames
 

Index: src/daemon/driver/driverInterface.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInterface.ml,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- src/daemon/driver/driverInterface.ml        23 Sep 2006 20:29:47 -0000      
1.54
+++ src/daemon/driver/driverInterface.ml        6 Oct 2006 15:57:18 -0000       
1.55
@@ -1100,12 +1100,14 @@
     Failure s ->
       gui_send gui (Console (Printf.sprintf "Failure: %s\n" s))
   | e ->
-      let error_text = Printexc2.to_string e in
-      if error_text = "BTInteractive.Torrent_can_not_be_used" then
+      match Printexc2.to_string e with
+       "BTInteractive.Torrent_can_not_be_used" ->
        gui_send gui (Console (Printf.sprintf "\nError: This torrent does not 
have valid tracker URLs\n"))
-      else
+      | "BTInteractive.Already_exists" ->
+         gui_send gui (Console (Printf.sprintf "\nError: This torrent is 
already in download queue\n"))
+      | 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)))
+          e (GuiProto.string_of_from_gui t)))
 
 let gui_events () = 
   {

Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- src/networks/bittorrent/bTInteractive.ml    1 Oct 2006 17:54:00 -0000       
1.114
+++ src/networks/bittorrent/bTInteractive.ml    6 Oct 2006 15:57:18 -0000       
1.115
@@ -1007,12 +1007,15 @@
     ), _s ":\t\t\t\tprint all .torrent files on this server";
 
     "seeded_torrents", "Network/Bittorrent", Arg_none (fun o ->
+      if CommonUserDb.user2_is_admin o.conn_user.ui_user_name then begin
       List.iter (fun file ->
           if file_state file = FileShared then
               Printf.bprintf o.conn_buf "%s [%s]\n" file.file_name 
(Int64.to_string file.file_uploaded)
       ) !current_files;
       _s "done"
-
+      end else
+      begin CommonUserDb.print_command_result o o.conn_buf "You are not 
allowed to use seeded_torrents";
+      "" end
     ), _s ":\t\t\tprint all seeded .torrent files on this server";
 
     "reshare_torrents", "Network/Bittorrent", Arg_none (fun o ->
@@ -1134,7 +1137,13 @@
     0 ->
       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)
+      with e -> (match e with
+         Torrent_can_not_be_used -> lprintf_nl "Loading torrent from GUI: this 
torrent can not be used"
+       | Already_exists -> lprintf_nl "Loading torrent from GUI: this torrent 
is already in download queue"
+       | _ -> ());
+       raise e)
   | 1 -> (* 34+ *)
       let n = get_int s 2 in
       let a, pos = get_string s 6 in




reply via email to

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