mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/bittorr...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/bittorr...
Date: Sun, 05 Mar 2006 10:40:04 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/03/05 10:40:04

Modified files:
        distrib        : ChangeLog 
        src/networks/bittorrent: bTGlobals.ml bTInteractive.ml bTMain.ml 

Log message:
        patch #4945

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.756&tr2=1.757&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/bittorrent/bTGlobals.ml.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml.diff?tr1=1.82&tr2=1.83&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/bittorrent/bTMain.ml.diff?tr1=1.18&tr2=1.19&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.756 mldonkey/distrib/ChangeLog:1.757
--- mldonkey/distrib/ChangeLog:1.756    Wed Mar  1 20:06:50 2006
+++ mldonkey/distrib/ChangeLog  Sun Mar  5 10:40:04 2006
@@ -14,6 +14,11 @@
 ChangeLog
 =========
 
+2006/03/05
+4945: BT: Automatically start new torrents downloads
+- new directory $MLDONKEY_DIR/torrents/incoming, all files present
+  in this dir are started automatically, its scanned every 10 seconds.
+
 2006/03/01
 4939: Support for compressed ipfilter.dat files (.gz, .bz2 or .zip) (pango)
 4930: giFT GUI: Authentication support (pango)
Index: mldonkey/src/networks/bittorrent/bTGlobals.ml
diff -u mldonkey/src/networks/bittorrent/bTGlobals.ml:1.51 
mldonkey/src/networks/bittorrent/bTGlobals.ml:1.52
--- mldonkey/src/networks/bittorrent/bTGlobals.ml:1.51  Sun Feb  5 18:35:50 2006
+++ mldonkey/src/networks/bittorrent/bTGlobals.ml       Sun Mar  5 10:40:04 2006
@@ -723,6 +723,7 @@
     ) file.file_trackers
 
 let torrents_directory = "torrents"
+let new_torrents_directory = Filename.concat torrents_directory "incoming"
 let downloads_directory = Filename.concat torrents_directory "downloads"
 let tracked_directory = Filename.concat torrents_directory "tracked"
 let seeded_directory = Filename.concat torrents_directory "seeded"
Index: mldonkey/src/networks/bittorrent/bTInteractive.ml
diff -u mldonkey/src/networks/bittorrent/bTInteractive.ml:1.82 
mldonkey/src/networks/bittorrent/bTInteractive.ml:1.83
--- mldonkey/src/networks/bittorrent/bTInteractive.ml:1.82      Thu Feb 23 
10:49:24 2006
+++ mldonkey/src/networks/bittorrent/bTInteractive.ml   Sun Mar  5 10:40:04 2006
@@ -602,6 +602,16 @@
         end
   ) shared_files_copy
 
+let scan_new_torrents_directory () =
+  let filenames = Unix2.list_directory new_torrents_directory in
+  List.iter (fun file ->
+    let file = Filename.concat new_torrents_directory file in
+    try
+      load_torrent_file file;
+      (try Sys.remove file with _ -> ())
+    with e -> lprintf_nl () "Error %s in scan_new_torrents_directory" 
(Printexc2.to_string e)
+  ) filenames
+
 let retry_all_ft () =
   Hashtbl.iter (fun _ ft ->
       try ft.ft_retry ft with e ->
Index: mldonkey/src/networks/bittorrent/bTMain.ml
diff -u mldonkey/src/networks/bittorrent/bTMain.ml:1.18 
mldonkey/src/networks/bittorrent/bTMain.ml:1.19
--- mldonkey/src/networks/bittorrent/bTMain.ml:1.18     Wed Nov 30 23:34:29 2005
+++ mldonkey/src/networks/bittorrent/bTMain.ml  Sun Mar  5 10:40:04 2006
@@ -59,11 +59,13 @@
     Unix2.safe_mkdir tracked_directory;
     Unix2.safe_mkdir downloads_directory;
     Unix2.safe_mkdir old_directory;
+    Unix2.safe_mkdir new_torrents_directory;
     Unix2.can_write_to_directory torrents_directory;
     Unix2.can_write_to_directory seeded_directory;
     Unix2.can_write_to_directory tracked_directory;
     Unix2.can_write_to_directory downloads_directory;
     Unix2.can_write_to_directory old_directory;
+    Unix2.can_write_to_directory new_torrents_directory;
     is_enabled := true;
     if !!BTTracker.tracker_port = !!client_port then
       begin
@@ -80,6 +82,9 @@
     add_session_timer enabler 300. (fun _ ->
         BTInteractive.share_files ();
     );
+    add_session_timer enabler 10. (fun _ ->
+        BTInteractive.scan_new_torrents_directory ();
+    );
     add_timer 10. BTInteractive.share_files;
     add_session_timer enabler 600. BTInteractive.retry_all_ft;
     network.op_network_disable <- disable enabler;




reply via email to

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