[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: |
Mon, 19 Feb 2007 21:19:44 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 07/02/19 21:19:44
Modified files:
distrib : ChangeLog
src/daemon/common: commonOptions.ml
src/networks/donkey: donkeyFiles.ml donkeyOptions.ml
src/utils/cdk : filename2.ml filename2.mli
Log message:
patch #5750
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1186&r2=1.1187
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.198&r2=1.199
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyFiles.ml?cvsroot=mldonkey&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyOptions.ml?cvsroot=mldonkey&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/cdk/filename2.ml?cvsroot=mldonkey&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/cdk/filename2.mli?cvsroot=mldonkey&r1=1.5&r2=1.6
Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1186
retrieving revision 1.1187
diff -u -b -r1.1186 -r1.1187
--- distrib/ChangeLog 18 Feb 2007 00:22:47 -0000 1.1186
+++ distrib/ChangeLog 19 Feb 2007 21:19:44 -0000 1.1187
@@ -14,6 +14,10 @@
ChangeLog
=========
+2007/02/19
+5750: EDK: New option upload_compression_ext_exclude (thx to pango)
+- space-separated list of file extensions which are not compressed when
uploaded
+
2007/02/18
5753: Multiuser: New variable $USER_MAIL for file_completed_cmd
5751: Improve startup log messages, remove unused code, optimize Date code
Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -b -r1.198 -r1.199
--- src/daemon/common/commonOptions.ml 18 Feb 2007 00:13:08 -0000 1.198
+++ src/daemon/common/commonOptions.ml 19 Feb 2007 21:19:44 -0000 1.199
@@ -283,14 +283,6 @@
None -> define_expert_option a b (_s c) d e ?restart ?public ?internal
| Some desc -> define_expert_option a b ~desc: (_s desc) (_s c) d e ?restart
?public ?internal
-let string_list_option = define_option_class "String"
- (fun v ->
- match v with
- List _ | SmallList _ -> ""
- | _ -> value_to_string v
- )
- string_to_value
-
let html_themes_dir = "html_themes"
let downloads_ini = create_options_file "downloads.ini"
let servers_ini = create_options_file "servers.ini"
@@ -309,7 +301,7 @@
let int_list_option = list_option int_option
-let country_list_option = list_option string_option
+let string_list_option = list_option string_option
let allow_browse_share_option = define_option_class "Integer"
(fun v ->
@@ -357,7 +349,7 @@
let list = String2.tokens s in
List.map (fun i -> int_of_string i) list
);
- Options.set_string_wrappers country_list_option
+ Options.set_string_wrappers string_list_option
(String.concat " ")
String2.tokens
@@ -1056,7 +1048,7 @@
"List of countries to block connections from/to (requires Geoip).
Names are in ISO 3166 format, see http://www.maxmind.com/app/iso3166
You can also at your own risk use \"Unknown\" for IPs Geoip won't recognize."
- country_list_option []
+ string_list_option []
let ip_blocking_countries_block = define_expert_option current_section
["ip_blocking_countries_block"]
"false: use ip_blocking_countries as block list, all other countries are
allowed
@@ -1379,10 +1371,6 @@
"keep seen files in history to allow local search (can be expensive in
memory)"
bool_option false
-let filters = define_option current_section ["filters"]
- "filters on replies (replies will be kept)."
- string_list_option ""
-
let buffer_writes = define_option current_section ["buffer_writes"]
"Buffer writes and flush after buffer_writes_delay seconds (experimental)"
bool_option false
Index: src/networks/donkey/donkeyFiles.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyFiles.ml,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- src/networks/donkey/donkeyFiles.ml 15 Jan 2007 18:28:03 -0000 1.27
+++ src/networks/donkey/donkeyFiles.ml 19 Feb 2007 21:19:44 -0000 1.28
@@ -207,7 +207,12 @@
(* Is there a message to warn that a file is not shared anymore ? *)
DonkeyOneFile.remove_client_slot c
else
- let compress = !!upload_compression &&
(c.client_emule_proto.emule_compression <> 0) in
+ let compress =
+ !!upload_compression &&
+ (c.client_emule_proto.emule_compression <> 0) &&
+ not (List.mem (String.lowercase (Filename2.last_extension2
(file_best_name up.up_file)))
+ !!upload_compression_ext_exclude)
+ in
let cfile,ccomp = match cached_load up.up_file begin_offset
end_offset compress with
Some (cached_file,cached_comp) -> cached_file,cached_comp
| _ -> "",""
Index: src/networks/donkey/donkeyOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyOptions.ml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- src/networks/donkey/donkeyOptions.ml 15 Jan 2007 18:26:27 -0000
1.61
+++ src/networks/donkey/donkeyOptions.ml 19 Feb 2007 21:19:44 -0000
1.62
@@ -202,10 +202,18 @@
counterpart, which has to occure, to send compressed parts instead of plain."
int_option 2000
+let upload_compression_ext_exclude = define_expert_option donkey_section
["upload_compression_ext_exclude"]
+ "Disable upload compression based on file extensions (without dot)"
+ string_list_option ["zip"; "7z"; "gz"; "bz2"; "rar"; "ace"; "ogm"; "avi";
"mpg"]
+
let _ =
option_hook upload_compression_threshold (fun _ ->
if !!upload_compression_threshold < 0 then
upload_compression_threshold =:= 0
+ );
+ option_hook upload_compression_ext_exclude (fun _ ->
+ let l = List.map String.lowercase !!upload_compression_ext_exclude in
+ if !!upload_compression_ext_exclude <> l then
upload_compression_ext_exclude =:= l
)
let upload_compression_level = define_expert_option donkey_section
["upload_compression_level"]
Index: src/utils/cdk/filename2.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/filename2.ml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- src/utils/cdk/filename2.ml 31 Oct 2006 15:40:06 -0000 1.6
+++ src/utils/cdk/filename2.ml 19 Feb 2007 21:19:44 -0000 1.7
@@ -71,15 +71,21 @@
| n -> String.sub name 0 n
with Not_found -> "."
-
let last_extension file =
try
let pos = String.rindex file '.' in
- let pos2 = try String.rindex file slash with _ -> 0 in
+ let pos2 = try String.rindex file slash with Not_found -> 0 in
if pos < pos2 then raise Not_found;
- let len = String.length file in
- String.sub file pos (len -pos)
- with _ -> ""
+ String2.after file pos
+ with Not_found -> ""
+
+let last_extension2 file =
+ try
+ let pos = String.rindex file '.' in
+ let pos2 = try String.rindex file slash with Not_found -> 0 in
+ if pos < pos2 then raise Not_found;
+ String2.after file (pos + 1)
+ with Not_found -> ""
let extension file =
try
Index: src/utils/cdk/filename2.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/filename2.mli,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- src/utils/cdk/filename2.mli 20 Jul 2006 15:30:21 -0000 1.5
+++ src/utils/cdk/filename2.mli 19 Feb 2007 21:19:44 -0000 1.6
@@ -34,6 +34,11 @@
which is the substring after the last "." in [filename]
(including the "."). If no extension is present, returns "". *)
+val last_extension2 : string -> string
+(*d [last_extension filename] returns the last extension of [filename],
+which is the substring after the last "." in [filename]
+ (without the "."). If no extension is present, returns "". *)
+
val extensions : string -> string list
(*d [extensions filename] returns the list of extensions (without the dot)
found at the end of filename. *)