[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, 31 Mar 2008 07:55:42 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 08/03/31 07:55:42
Modified files:
distrib : ChangeLog
src/daemon/common: commonFile.ml
Log message:
patch #6472
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1369&r2=1.1370
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.ml?cvsroot=mldonkey&r1=1.78&r2=1.79
Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1369
retrieving revision 1.1370
diff -u -b -r1.1369 -r1.1370
--- distrib/ChangeLog 31 Mar 2008 07:55:11 -0000 1.1369
+++ distrib/ChangeLog 31 Mar 2008 07:55:42 -0000 1.1370
@@ -15,6 +15,7 @@
=========
2008/03/31
+6472: Multiuser: Count only files in download queue for user/group statistics
6471: Clean logfile
6470: BT: Use default of max_upload_slots as minimum for BT-max_bt_uploaders
instead of hard-coded value
Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- src/daemon/common/commonFile.ml 14 Mar 2008 08:50:52 -0000 1.78
+++ src/daemon/common/commonFile.ml 31 Mar 2008 07:55:42 -0000 1.79
@@ -283,14 +283,28 @@
(fun file -> user2_can_view_file gui_user (file_owner file) (file_group
file)) files in
newlist
+let file_state file =
+ let impl = as_file_impl file in
+ impl.impl_file_state
+
let user2_num_user_dls user =
+ let file_is_in_download_queue file =
+ match file_state file with
+ | FileNew | FileDownloading | FileQueued | FilePaused | FileDownloaded ->
true
+ | FileShared | FileCancelled | FileAborted _ -> false
+ in
let n = ref 0 in
- H.iter (fun f -> if file_owner f = user then incr n) files_by_num;
+ H.iter (fun f -> if file_owner f = user && file_is_in_download_queue f then
incr n) files_by_num;
!n
let user2_num_group_dls group =
+ let file_is_in_download_queue file =
+ match file_state file with
+ | FileNew | FileDownloading | FileQueued | FilePaused | FileDownloaded ->
true
+ | FileShared | FileCancelled | FileAborted _ -> false
+ in
let n = ref 0 in
- H.iter (fun f -> if file_group f = Some group then incr n) files_by_num;
+ H.iter (fun f -> if file_group f = Some group && file_is_in_download_queue f
then incr n) files_by_num;
!n
let set_file_state file state =
@@ -445,10 +459,6 @@
dummy_file_impl with impl_file_num = num
})
-let file_state file =
- let impl = as_file_impl file in
- impl.impl_file_state
-
let file_add_source (file : file) c =
client_must_update c;
CommonEvent.add_event (File_add_source_event (file,c))