[Top][All Lists]
[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: |
Tue, 05 Sep 2006 14:18:25 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 06/09/05 14:18:24
Modified files:
distrib : ChangeLog
src/daemon/common: commonFile.ml commonFile.mli commonGlobals.ml
commonInteractive.ml commonOptions.ml
commonTypes.ml
src/daemon/driver: driverCommands.ml driverControlers.ml
driverInteractive.ml
src/networks/bittorrent: bTInteractive.ml
src/networks/donkey: donkeyClient.ml donkeyGlobals.ml
donkeyInteractive.ml donkeyProtoClient.ml
donkeyTypes.ml
Log message:
patch #5371
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.993&r2=1.994
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.ml?cvsroot=mldonkey&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.mli?cvsroot=mldonkey&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonGlobals.ml?cvsroot=mldonkey&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonInteractive.ml?cvsroot=mldonkey&r1=1.79&r2=1.80
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.174&r2=1.175
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonTypes.ml?cvsroot=mldonkey&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverCommands.ml?cvsroot=mldonkey&r1=1.171&r2=1.172
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverControlers.ml?cvsroot=mldonkey&r1=1.83&r2=1.84
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInteractive.ml?cvsroot=mldonkey&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTInteractive.ml?cvsroot=mldonkey&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyClient.ml?cvsroot=mldonkey&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyGlobals.ml?cvsroot=mldonkey&r1=1.92&r2=1.93
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyInteractive.ml?cvsroot=mldonkey&r1=1.121&r2=1.122
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyProtoClient.ml?cvsroot=mldonkey&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyTypes.ml?cvsroot=mldonkey&r1=1.46&r2=1.47
Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.993
retrieving revision 1.994
diff -u -b -r1.993 -r1.994
--- distrib/ChangeLog 5 Sep 2006 14:15:19 -0000 1.993
+++ distrib/ChangeLog 5 Sep 2006 14:18:24 -0000 1.994
@@ -15,6 +15,9 @@
=========
2006/09/05
+5371: EDK: Support for eMule comments (read-only)
+- new option html_mods_vd_comments to enable column in HTML, vd
+- comments are shown in javascript popups and vd #num
5369: New command portinfo, display used ports during start-up
2006/09/04
Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- src/daemon/common/commonFile.ml 1 Sep 2006 16:22:14 -0000 1.59
+++ src/daemon/common/commonFile.ml 5 Sep 2006 14:18:24 -0000 1.60
@@ -44,7 +44,7 @@
mutable impl_file_update : int;
mutable impl_file_state : file_state;
- mutable impl_file_comment : string;
+ mutable impl_file_comment : string list;
mutable impl_file_num : int;
mutable impl_file_val : 'a;
mutable impl_file_ops : 'a file_ops;
@@ -85,7 +85,6 @@
mutable op_file_recover : ('a -> unit);
mutable op_file_all_sources : ('a -> client list);
mutable op_file_active_sources : ('a -> client list);
- mutable op_file_comment : ('a -> string);
mutable op_file_set_priority : ('a -> int -> unit);
mutable op_file_print_html : ('a -> Buffer.t -> unit);
mutable op_file_print_sources_html : ('a -> Buffer.t -> unit);
@@ -132,7 +131,7 @@
impl_file_magic = None;
impl_file_priority = 0;
impl_file_last_seen = 0;
- impl_file_comment = "";
+ impl_file_comment = [];
impl_file_probable_name = None;
}
@@ -209,10 +208,6 @@
let file = as_file_impl file in
file.impl_file_ops.op_file_save_as file.impl_file_val name
-let file_comment (file : file) =
- let file = as_file_impl file in
- file.impl_file_ops.op_file_comment file.impl_file_val
-
let file_network (file : file) =
let file = as_file_impl file in
file.impl_file_ops.op_file_network
@@ -242,12 +237,15 @@
update_file_state impl state
let set_file_comment file comment =
- let impl = as_file_impl file in
- impl.impl_file_comment <- comment
+ if not (List.mem comment (as_file_impl file).impl_file_comment) then
+ (as_file_impl file).impl_file_comment <-
+ (as_file_impl file).impl_file_comment @ [(HashComments.merge file_comments
comment)]
let file_comment file =
- let impl = as_file_impl file in
- impl.impl_file_comment
+ (as_file_impl file).impl_file_comment
+
+let file_comment_length file =
+ List.length (as_file_impl file).impl_file_comment
let file_best_name (file : file) =
let file = as_file_impl file in
@@ -607,32 +605,33 @@
if use_html_mods o then begin
+ html_mods_cntr_init ();
html_mods_table_header buf "sourcesInfo" "sourcesInfo" [
( "0", "srh br", "File Info", "Info" ) ;
( "0", "srh", "Value", "Value" ) ];
- Printf.bprintf buf "\\<tr class=\\\"dl-1\\\"\\>";
+ Printf.bprintf buf "\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr ());
html_mods_td buf [
("File number/Network", "sr br", "[#] Network");
("", "sr", Printf.sprintf "[%d] %s" (file_num file) n.network_name) ];
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
html_mods_td buf [
("Downloaded/Total size", "sr br", "DLed/Size");
("", "sr", Printf.sprintf "%s bytes of %s bytes"
(Int64.to_string info.G.file_downloaded) (Int64.to_string
info.G.file_size) ) ];
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
html_mods_td buf [
("File priority", "sr br", "Priority");
("", "sr", Printf.sprintf "%d" (file_priority file)) ];
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
html_mods_td buf [
("Number of file sources", "sr br", "Sources");
("", "sr", Printf.sprintf "%d" (List.length srcs)) ];
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
(match info.G.file_chunks with
| None -> ()
@@ -666,12 +665,28 @@
(match file_magic file with
Some magic ->
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
html_mods_td buf [
("File type computed by libmagic", "sr br", "File magic");
("", "sr", magic) ]
| _ -> ());
+ (
+ if file_comment file <> [] then
+ begin
+ let list_header = ref true in
+ List.iter (fun s ->
+ Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>"
(html_mods_cntr ());
+ if !list_header then html_mods_td buf [
+ ("File comments", "sr br", "File comments");
+ ("", "sr", s) ]
+ else
+ html_mods_td buf [
+ ("", "sr br", "");
+ ("", "sr", s) ];
+ if !list_header then list_header := false) (file_comment file);
+ end);
+
file_print_html file buf;
Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>";
@@ -866,7 +881,6 @@
op_file_set_format = (fun _ -> fni network "file_set_format");
op_file_all_sources = (fun _ -> fni network "file_all_sources");
op_file_active_sources = (fun _ -> fni network "file_active_sources");
- op_file_comment = (fun _ -> ni_ok network "file_comment"; "");
op_file_set_priority = (fun _ _ -> ni_ok network "file_set_priority");
op_file_print_html = (fun _ _ -> ni_ok network "file_print_html");
op_file_print_sources_html = (fun _ _ -> fni network
"file_print_sources_html");
@@ -938,6 +952,9 @@
let counter = ref 0 in
HashMagic.iter (fun _ -> incr counter) files_magic;
Printf.bprintf buf " files_magic: %d\n" !counter;
+ let counter = ref 0 in
+ HashComments.iter (fun _ -> incr counter) file_comments;
+ Printf.bprintf buf " files_comments: %d\n" !counter
)
@@ -1055,7 +1072,7 @@
let module T = GuiTypes in
{
T.file_fields = T.Fields_file_info.all;
- T.file_comment = impl.impl_file_comment;
+ T.file_comment = "";
T.file_name = impl.impl_file_best_name;
T.file_names = impl.impl_file_filenames;
T.file_num = impl.impl_file_num;
Index: src/daemon/common/commonFile.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.mli,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- src/daemon/common/commonFile.mli 1 Sep 2006 16:22:14 -0000 1.19
+++ src/daemon/common/commonFile.mli 5 Sep 2006 14:18:24 -0000 1.20
@@ -21,7 +21,7 @@
mutable impl_file_update : int;
mutable impl_file_state : CommonTypes.file_state;
- mutable impl_file_comment : string;
+ mutable impl_file_comment : string list;
mutable impl_file_num : int;
mutable impl_file_val : 'a;
mutable impl_file_ops : 'a file_ops;
@@ -53,7 +53,6 @@
mutable op_file_recover : 'a -> unit;
mutable op_file_all_sources : 'a -> CommonTypes.client list;
mutable op_file_active_sources : 'a -> CommonTypes.client list;
- mutable op_file_comment : 'a -> string;
mutable op_file_set_priority : 'a -> int -> unit;
mutable op_file_print_html: 'a -> Buffer.t -> unit;
mutable op_file_print_sources_html : 'a -> Buffer.t -> unit;
@@ -76,7 +75,6 @@
val update_file_state : 'a file_impl -> CommonTypes.file_state -> unit
val file_to_option : CommonTypes.file -> (string * Options.option_value) list
val file_save_as : CommonTypes.file -> string -> unit
-val file_comment : CommonTypes.file -> string
val file_network : CommonTypes.file -> CommonTypes.network
val file_info : CommonTypes.file -> GuiTypes.file_info
val file_pause : CommonTypes.file -> unit
@@ -120,7 +118,8 @@
val set_file_last_seen : CommonTypes.file -> int -> unit
val file_debug : CommonTypes.file -> string
val set_file_comment : CommonTypes.file -> string -> unit
-val file_comment : CommonTypes.file -> string
+val file_comment : CommonTypes.file -> string list
+val file_comment_length : CommonTypes.file -> int
val file_magic : CommonTypes.file -> string option
val set_file_magic : CommonTypes.file -> string option -> unit
val check_magic : CommonTypes.file -> unit
Index: src/daemon/common/commonGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonGlobals.ml,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- src/daemon/common/commonGlobals.ml 3 Sep 2006 11:45:55 -0000 1.68
+++ src/daemon/common/commonGlobals.ml 5 Sep 2006 14:18:24 -0000 1.69
@@ -893,3 +893,11 @@
end)
let files_magic = HashMagic.create 100
+
+module HashComments = Weak.Make(struct
+ type t = string
+ let hash s = Hashtbl.hash s
+ let equal x y = x = y
+ end)
+
+let file_comments = HashComments.create 1000
Index: src/daemon/common/commonInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonInteractive.ml,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- src/daemon/common/commonInteractive.ml 1 Sep 2006 16:18:53 -0000
1.79
+++ src/daemon/common/commonInteractive.ml 5 Sep 2006 14:18:24 -0000
1.80
@@ -320,8 +320,11 @@
(let age = (BasicSocket.last_time ()) - info.G.file_age in
Date.time_to_string age "verbose")
in
- let line3 = if (file_comment file) = "" then "" else
- Printf.sprintf "\r\nComment: %s\r\n" (file_comment file)
+ let line3 = if (file_comment file) = [] then "" else
+ let buf = Buffer.create 1000 in
+ Printf.bprintf buf "\r\nComments:\r\n";
+ List.iter (fun s -> Printf.bprintf buf "%s\r\n" s;) (file_comment file);
+ Buffer.contents buf
in
let subject = if !!filename_in_subject then
Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -b -r1.174 -r1.175
--- src/daemon/common/commonOptions.ml 4 Sep 2006 21:30:26 -0000 1.174
+++ src/daemon/common/commonOptions.ml 5 Sep 2006 14:18:24 -0000 1.175
@@ -721,6 +721,10 @@
"Whether to display the Net column in vd output"
bool_option true
+let html_mods_vd_comments = define_expert_option current_section
["html_mods_vd_comments"]
+ "Whether to display the Comments column in vd output"
+ bool_option true
+
let html_mods_vd_active_sources = define_expert_option current_section
["html_mods_vd_active_sources"]
"Whether to display the Active Sources column in vd output"
bool_option true
Index: src/daemon/common/commonTypes.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonTypes.ml,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- src/daemon/common/commonTypes.ml 5 Sep 2006 14:15:19 -0000 1.54
+++ src/daemon/common/commonTypes.ml 5 Sep 2006 14:18:24 -0000 1.55
@@ -375,6 +375,7 @@
| ByASources
| ByNet
| ByAvail
+| ByComments
| NotSorted
type room_state =
Index: src/daemon/driver/driverCommands.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- src/daemon/driver/driverCommands.ml 5 Sep 2006 14:15:19 -0000 1.171
+++ src/daemon/driver/driverCommands.ml 5 Sep 2006 14:18:24 -0000 1.172
@@ -1560,6 +1560,7 @@
strings_of_option html_mods_use_relative_availability;
strings_of_option html_mods_human_readable;
strings_of_option html_mods_vd_network;
+ strings_of_option html_mods_vd_comments;
strings_of_option html_mods_vd_active_sources;
strings_of_option html_mods_vd_age;
strings_of_option html_mods_vd_last;
Index: src/daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- src/daemon/driver/driverControlers.ml 3 Sep 2006 11:48:22 -0000
1.83
+++ src/daemon/driver/driverControlers.ml 5 Sep 2006 14:18:24 -0000
1.84
@@ -1312,6 +1312,7 @@
| "A" -> o.conn_sortvd <- ByASources
| "N" -> o.conn_sortvd <- ByNet
| "Avail" -> o.conn_sortvd <- ByAvail
+ | "Cm" -> o.conn_sortvd <- ByComments
| _ -> ()
end
| _ -> ()
Index: src/daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- src/daemon/driver/driverInteractive.ml 5 Sep 2006 14:15:19 -0000
1.99
+++ src/daemon/driver/driverInteractive.ml 5 Sep 2006 14:18:24 -0000
1.100
@@ -679,8 +679,13 @@
"\\<td title=\\\"Sort by filename\\\" class=dlheader\\>\\<input
class=headbutton type=submit value=File name=sortby\\>\\</td\\>
\\<td title=\\\"Sort by size\\\" class=dlheader\\>\\<input class=headbutton
type=submit value=Size name=sortby\\>\\</td\\>
\\<td title=\\\"Sort by size downloaded\\\" class=dlheader\\>\\<input
class=\\\"headbutton ar\\\" type=submit value=DLed name=sortby\\>\\</td\\>
-\\<td title=\\\"Sort by percent\\\" class=dlheader\\>\\<input class=headbutton
type=submit value=%% name=sortby\\>\\</td\\>
-\\<td title=\\\"Sort by number of sources\\\" class=dlheader\\>\\<input
style=\\\"padding-left: 0px; padding-right: 0px;\\\" class=headbutton
type=submit value=Srcs name=sortby\\>\\</td\\>";
+\\<td title=\\\"Sort by percent\\\" class=dlheader\\>\\<input class=headbutton
type=submit value=%% name=sortby\\>\\</td\\>";
+
+if !!html_mods_vd_comments then Printf.bprintf buf
+"\\<td title=\\\"Sort by comments\\\" class=dlheader\\>\\<input
style=\\\"padding-left: 0px; padding-right: 0px;\\\" class=headbutton
type=submit value=Cm name=sortby\\>\\</td\\>";
+
+Printf.bprintf buf
+"\\<td title=\\\"Sort by number of sources\\\" class=dlheader\\>\\<input
style=\\\"padding-left: 0px; padding-right: 0px;\\\" class=headbutton
type=submit value=Srcs name=sortby\\>\\</td\\>";
if !!html_mods_vd_active_sources then Printf.bprintf buf
"\\<td title=\\\"Sort by number of active sources\\\"
class=dlheader\\>\\<input style=\\\"padding-left: 0px; padding-right: 0px;\\\"
class=headbutton type=submit value=A name=sortby\\>\\</td\\>";
@@ -710,13 +715,21 @@
[|
(if !!html_mods_use_js_tooltips then
Printf.sprintf "
-
onMouseOver=\\\"mOvr(this);setTimeout('popLayer(\\\\\'%s<br>%sFile#:
%d<br>Network: %s\\\\\')',%d);setTimeout('hideLayer()',%d);return true;\\\"
onMouseOut=\\\"mOut(this);hideLayer();setTimeout('hideLayer()',%d)\\\"\\>"
+
onMouseOver=\\\"mOvr(this);setTimeout('popLayer(\\\\\'%s<br>%sFile#:
%d<br>Network: %s%s\\\\\')',%d);setTimeout('hideLayer()',%d);return true;\\\"
onMouseOut=\\\"mOut(this);hideLayer();setTimeout('hideLayer()',%d)\\\"\\>"
(Http_server.html_real_escaped file.file_name)
(match file_magic (file_find file.file_num) with
None -> ""
| Some magic -> "File type: " ^
(Http_server.html_real_escaped magic) ^ "<br>")
file.file_num
(net_name file)
+ (let comments = file_comment (file_find file.file_num)
in
+ if comments = [] then "" else
+ begin
+ let buf1 = Buffer.create 100 in
+ Printf.bprintf buf1 "<br><br>Comments:<br>";
+ List.iter (fun s -> Printf.bprintf buf1 "%s<br>"
(Http_server.html_real_escaped s)) comments;
+ Buffer.contents buf1
+ end)
!!html_mods_js_tooltips_wait
!!html_mods_js_tooltips_timeout
!!html_mods_js_tooltips_wait
@@ -778,6 +791,12 @@
(ctd file.file_num (size_of_int64 file.file_size));
(ctd file.file_num (size_of_int64 file.file_downloaded));
(ctd file.file_num (Printf.sprintf "%.1f" (percent file)));
+
+ (if !!html_mods_vd_comments then
+ Printf.sprintf "\\<td
onClick=\\\"location.href='submit?q=vd+%d';return true;\\\"
+ class=\\\"dl al\\\"\\>%d\\</td\\>"
+ file.file_num (file_comment_length (file_find
file.file_num)) else "");
+
(ctd file.file_num (Printf.sprintf "%d" (number_of_sources file)));
(if !!html_mods_vd_active_sources then
@@ -1093,6 +1112,7 @@
| ByLast -> (fun f1 f2 -> f1.file_last_seen >= f2.file_last_seen)
| ByNet -> (fun f1 f2 -> net_name f1 <= net_name f2)
| ByAvail -> (fun f1 f2 -> get_file_availability f1 >=
get_file_availability f2)
+ | ByComments -> (fun f1 f2 -> file_comment_length (file_find
f1.file_num) >= file_comment_length (file_find f2.file_num))
| NotSorted -> raise Not_found
in
Sort.list sorter list
Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- src/networks/bittorrent/bTInteractive.ml 5 Sep 2006 14:15:19 -0000
1.105
+++ src/networks/bittorrent/bTInteractive.ml 5 Sep 2006 14:18:24 -0000
1.106
@@ -443,7 +443,7 @@
{
P.file_fields = P.Fields_file_info.all;
- P.file_comment = file_comment (as_ft ft);
+ P.file_comment = "";
P.file_name = ft.ft_filename;
P.file_num = ft_num ft;
P.file_network = network.network_num;
Index: src/networks/donkey/donkeyClient.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyClient.ml,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- src/networks/donkey/donkeyClient.ml 1 Sep 2006 16:22:14 -0000 1.98
+++ src/networks/donkey/donkeyClient.ml 5 Sep 2006 14:18:24 -0000 1.99
@@ -1272,6 +1272,9 @@
(Printexc2.to_string e);
end;
+ | M.EmuleFileDescReq (rate, comment) ->
+ if comment <> "" then set_file_comment c.client_last_asked_file comment
+
| M.AvailableSlotReq _ ->
set_lifetime sock active_lifetime;
set_rtimeout sock !!queued_timeout;
@@ -2507,6 +2510,7 @@
try
let c = find_client_by_key s_uid in
let file = find_file (Md4.of_string file_uid) in
+ c.client_last_asked_file <- (as_file file);
c.client_requests_sent <- c.client_requests_sent + 1;
let module M = DonkeyProtoClient in
Index: src/networks/donkey/donkeyGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyGlobals.ml,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- src/networks/donkey/donkeyGlobals.ml 5 Sep 2006 14:15:20 -0000
1.92
+++ src/networks/donkey/donkeyGlobals.ml 5 Sep 2006 14:18:24 -0000
1.93
@@ -563,6 +563,7 @@
client_file_queue = [];
client_tags = [];
client_name = "";
+ client_last_asked_file = dummy_file;
client_all_files = None;
client_rating = 0;
client_brand = Brand_unknown;
Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- src/networks/donkey/donkeyInteractive.ml 3 Sep 2006 11:49:17 -0000
1.121
+++ src/networks/donkey/donkeyInteractive.ml 5 Sep 2006 14:18:24 -0000
1.122
@@ -835,7 +835,7 @@
\\<input style=\\\"font: 8pt sans-serif\\\" name=\\\"newName\\\"
type=text size=50 value=\\\"%s\\\"\\>\\</input\\>\\</td\\>\\</form\\>
\\<td class=\\\"sr \\\"\\>%s\\</td\\>
\\<td class=\\\"sr \\\"\\>\\<A
HREF=\\\"%s\\\"\\>%s\\</A\\>\\</td\\>\\</tr\\>"
- !tr fnum fnum fnum (file_best_name file) "Downloading"
(file_comment (as_file file)) filename
+ !tr fnum fnum fnum (file_best_name file) "Downloading"
(file_print_ed2k_link (file_best_name file) (file_size file) file.file_md4)
filename
else
Printf.bprintf buf "%s is %s %s\n" filename
(file_best_name file)
@@ -1442,9 +1442,6 @@
DonkeyProtoOvernet.Overnet.cancel_recover_file file;
DonkeyProtoKademlia.Kademlia.cancel_recover_file file;
);
- file_ops.op_file_comment <- (fun file ->
- 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
None -> [CommonFile.as_file impl]
Index: src/networks/donkey/donkeyProtoClient.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyProtoClient.ml,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- src/networks/donkey/donkeyProtoClient.ml 11 Feb 2006 14:52:45 -0000
1.35
+++ src/networks/donkey/donkeyProtoClient.ml 5 Sep 2006 14:18:24 -0000
1.36
@@ -1081,7 +1081,7 @@
| EmuleQueueRankingReq of EmuleQueueRanking.t
| EmuleRequestSourcesReq of EmuleRequestSources.t
| EmuleRequestSourcesReplyReq of EmuleRequestSourcesReply.t
-| EmuleFileDescReq of string
+| EmuleFileDescReq of int * string
| EmulePublicKeyReq of EmulePublicKeyReq.t
| EmuleSignatureReq of EmuleSignatureReq.t
| EmuleSecIdentStateReq of EmuleSecIdentStateReq.t
@@ -1133,8 +1133,8 @@
| EmuleRequestSourcesReplyReq t ->
EmuleRequestSourcesReply.print t
- | EmuleFileDescReq t ->
- lprintf "EMULE FILE DESC %s" t
+ | EmuleFileDescReq (rating, comment) ->
+ lprintf "EMULE FILE DESC %s" comment
| EmuleMultiPacketReq (md4, list) ->
lprintf_nl "EmuleMultiPacket for %s:" (Md4.to_string md4);
@@ -1198,7 +1198,7 @@
| 0x61 (* 97 *) ->
let rating = get_uint8 s 1 in
let (comment,_) = get_string32 s 2 in
- EmuleFileDescReq (Printf.sprintf "(%d) %s" rating comment)
+ EmuleFileDescReq (rating, comment)
| 0x81 (* 129 *) -> EmuleRequestSourcesReq (EmuleRequestSources.parse len
s)
| 0x82 (* 130 *) ->
@@ -1514,10 +1514,10 @@
| EmuleRequestSourcesReplyReq t ->
buf_int8 buf 0x82;
EmuleRequestSourcesReply.write emule buf t
- | EmuleFileDescReq t ->
+ | EmuleFileDescReq (rating, comment) ->
buf_int8 buf 0x61;
- buf_int8 buf 1;
- buf_string buf t
+ buf_int8 buf rating;
+ buf_string buf comment
| EmuleCompressedPart (md4, statpos, newsize, bloc) ->
buf_int8 buf 0x40;
Index: src/networks/donkey/donkeyTypes.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyTypes.ml,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- src/networks/donkey/donkeyTypes.ml 4 Sep 2006 21:30:27 -0000 1.46
+++ src/networks/donkey/donkeyTypes.ml 5 Sep 2006 14:18:24 -0000 1.47
@@ -519,6 +519,7 @@
CommonSwarming.uploader
) list;
mutable client_all_files : result list option;
+ mutable client_last_asked_file : CommonTypes.file;
mutable client_tags: CommonTypes.tag list;
mutable client_name : string;
mutable client_rating : int ;
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/01
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/01
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/03
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/03
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/04
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/05
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...,
mldonkey-commits <=
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/14
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/14
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/16
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/16
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/19
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/22
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/23
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/23
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/25
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2006/09/25