diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x '*.cmi' -x '*.cma' -x '*.cmo' -x '*.cmx' -x '*.cmxa' -x '*.a' -x '*.o' -x .depend -x Makefile -x mlnet -x ocamlpp.byte -N -r -u ./src/daemon/common/commonShared.ml ./src/daemon/common/commonShared.ml
--- ./src/daemon/common/commonShared.ml 2007-06-17 03:21:45.000000000 +0200
+++ ./src/daemon/common/commonShared.ml 2008-01-01 22:56:20.000000000 +0100
@@ -50,7 +50,7 @@
and 'a shared_ops = {
mutable op_shared_info : ('a -> GuiTypes.shared_info);
mutable op_shared_unshare : ('a -> unit);
- mutable op_shared_state : (CommonTypes.file -> CommonTypes.ui_conn -> string);
+ mutable op_shared_state : ('a -> CommonTypes.ui_conn -> string);
}
let as_shared (shared : 'a shared_impl) =
@@ -186,7 +186,7 @@
try
match impl.impl_shared_file with
| None -> ""
- | Some f -> impl.impl_shared_ops.op_shared_state f o
+ | Some f -> impl.impl_shared_ops.op_shared_state impl.impl_shared_val o
with _ -> ""
let shared_dir = function
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x '*.cmi' -x '*.cma' -x '*.cmo' -x '*.cmx' -x '*.cmxa' -x '*.a' -x '*.o' -x .depend -x Makefile -x mlnet -x ocamlpp.byte -N -r -u ./src/daemon/common/commonShared.mli ./src/daemon/common/commonShared.mli
--- ./src/daemon/common/commonShared.mli 2006-12-03 21:57:56.000000000 +0100
+++ ./src/daemon/common/commonShared.mli 2008-01-01 21:48:50.000000000 +0100
@@ -15,7 +15,7 @@
and 'a shared_ops = {
mutable op_shared_info : 'a -> GuiTypes.shared_info;
mutable op_shared_unshare : 'a -> unit;
- mutable op_shared_state : CommonTypes.file -> CommonTypes.ui_conn -> string;
+ mutable op_shared_state : 'a -> CommonTypes.ui_conn -> string;
}
val dirnames_prio : (string * int) list ref
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x '*.cmi' -x '*.cma' -x '*.cmo' -x '*.cmx' -x '*.cmxa' -x '*.a' -x '*.o' -x .depend -x Makefile -x mlnet -x ocamlpp.byte -N -r -u ./src/networks/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ./src/networks/bittorrent/bTInteractive.ml 2007-08-04 00:12:58.000000000 +0200
+++ ./src/networks/bittorrent/bTInteractive.ml 2008-01-02 14:12:06.000000000 +0100
@@ -1091,6 +1091,35 @@
_s ""
), _s ":\t\t\t\tprint all .torrent files on this server";
+ "print_torrent", "Network/Bittorrent", Arg_one (fun arg o ->
+ if CommonUserDb.user2_is_admin o.conn_user.ui_user then begin
+ let file =
+ try
+ Some (as_file_impl (file_find (int_of_string arg)))
+ with _ -> None
+ in
+ match file with
+ | None -> Printf.sprintf "file %s not found" arg
+ | Some file ->
+ (
+ if use_html_mods o then begin
+ html_mods_cntr_init ();
+ html_mods_table_header o.conn_buf "sourcesInfo" "sourcesInfo" [
+ ( "0", "srh br", "File Info", "Info" ) ;
+ ( "0", "srh", "Value", "Value" ) ]
+ end;
+ op_file_print file.impl_file_val o;
+ if use_html_mods o then begin
+ Printf.bprintf o.conn_buf "\\\\\\";
+ Printf.bprintf o.conn_buf "\\\\\\\\\\
"
+ end
+ );
+ ""
+ end else
+ begin print_command_result o "You are not allowed to use print_torrent";
+ "" end
+ ), _s " :\t\t\tshow internal data of .torrent file";
+
"seeded_torrents", "Network/Bittorrent", Arg_none (fun o ->
if CommonUserDb.user2_is_admin o.conn_user.ui_user then begin
List.iter (fun file ->
@@ -1330,7 +1359,10 @@
CommonNetwork.register_commands commands;
shared_ops.op_shared_state <- (fun file o ->
- "no BT data"
+ if o.conn_output = HTML then
+ Printf.sprintf "\\Details\\"
+ (file_num file)
+ else Printf.sprintf "Shared using %s" file.file_torrent_diskname
);
shared_ops.op_shared_unshare <- (fun file ->
(if !verbose_share then lprintf_file_nl (as_file file) "unshare file");
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x '*.cmi' -x '*.cma' -x '*.cmo' -x '*.cmx' -x '*.cmxa' -x '*.a' -x '*.o' -x .depend -x Makefile -x mlnet -x ocamlpp.byte -N -r -u ./src/networks/donkey/donkeyInteractive.ml ./src/networks/donkey/donkeyInteractive.ml
--- ./src/networks/donkey/donkeyInteractive.ml 2007-10-17 20:25:02.000000000 +0200
+++ ./src/networks/donkey/donkeyInteractive.ml 2008-01-01 21:49:31.000000000 +0100
@@ -1888,9 +1888,9 @@
let _ =
shared_ops.op_shared_state <- (fun f o ->
- match CommonFile.file_state f with
+ match file_state f with
| FileShared ->
- (match file_shared f with
+ (match file_shared (as_file f) with
| None -> "no file_shared info"
| Some f ->
let pre_share1_dir =