mldonkey-commits
[Top][All Lists]
Advanced

[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: Thu, 10 Aug 2006 17:41:20 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/08/10 17:41:20

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonFile.ml commonSwarming.ml 
        src/daemon/driver: driverControlers.ml 
        src/gtk2/gui   : guiGlobal.ml 
        src/networks/bittorrent: bTInteractive.ml 
        src/networks/fileTP: fileTPHTTP.ml fileTPInteractive.ml 
        src/networks/gnutella: gnutellaInteractive.ml 
        src/utils/lib  : autoconf.ml.new.in 

Log message:
        patch #5294

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.949&r2=1.950
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.ml?cvsroot=mldonkey&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonSwarming.ml?cvsroot=mldonkey&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverControlers.ml?cvsroot=mldonkey&r1=1.79&r2=1.80
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/gtk2/gui/guiGlobal.ml?cvsroot=mldonkey&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTInteractive.ml?cvsroot=mldonkey&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/fileTP/fileTPHTTP.ml?cvsroot=mldonkey&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/fileTP/fileTPInteractive.ml?cvsroot=mldonkey&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/gnutella/gnutellaInteractive.ml?cvsroot=mldonkey&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/autoconf.ml.new.in?cvsroot=mldonkey&r1=1.24&r2=1.25

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.949
retrieving revision 1.950
diff -u -b -r1.949 -r1.950
--- distrib/ChangeLog   9 Aug 2006 16:01:27 -0000       1.949
+++ distrib/ChangeLog   10 Aug 2006 17:41:19 -0000      1.950
@@ -14,6 +14,9 @@
 ChangeLog
 =========
 
+2006/08/10
+5294: Clean logging, small "if .. then true else false" function rewrites
+
 2006/08/09
 5288: EDK: Improve log when sharing is prevented due to inconsistent filesizes
 5287: Swarmer: Remove obsolete option file_bitmap from files.ini

Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- src/daemon/common/commonFile.ml     20 Jul 2006 15:30:21 -0000      1.56
+++ src/daemon/common/commonFile.ml     10 Aug 2006 17:41:19 -0000      1.57
@@ -500,7 +500,7 @@
           | _ -> ()
       ) srcs;
 
-       if !counter mod 2 = 0 then true else false
+       !counter mod 2 = 0
 
 (*************************************************************************)
 (*                                                                       *)

Index: src/daemon/common/commonSwarming.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonSwarming.ml,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- src/daemon/common/commonSwarming.ml 8 Aug 2006 23:59:01 -0000       1.49
+++ src/daemon/common/commonSwarming.ml 10 Aug 2006 17:41:19 -0000      1.50
@@ -2366,9 +2366,6 @@
           currently they're taken care of by linear_select_block
           fallback below *)
 
-       if debug_memoization then
-         lprintf_nl "memoization hits: %d/%d" !memoization_hits 
!memoization_calls;
-
        if debug_all then begin
          print_choice specimen
        end;
@@ -2692,9 +2689,11 @@
                | CompleteBlock | VerifiedBlock -> false
                | PartialBlock b -> b.block_unselected_remaining > 0L in
              if partial_found then begin
+(*
                if debug_all || !verbose then
                  lprintf_nl "find_range: Client %d better switch cluster now!" 
                    (client_num up.up_client);
+*)
                raise Not_found
              end
        done

Index: src/daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- src/daemon/driver/driverControlers.ml       27 Jul 2006 21:45:05 -0000      
1.79
+++ src/daemon/driver/driverControlers.ml       10 Aug 2006 17:41:19 -0000      
1.80
@@ -763,7 +763,7 @@
         let fname = Filename.concat theme page in fname
 
 let theme_page_exists page =
-        if Sys.file_exists (get_theme_page page) then true else false
+    Sys.file_exists (get_theme_page page)
 
 (* if files are small really_input should be okay *)
 let read_theme_page page =

Index: src/gtk2/gui/guiGlobal.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/gtk2/gui/guiGlobal.ml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/gtk2/gui/guiGlobal.ml   22 Nov 2005 17:59:32 -0000      1.4
+++ src/gtk2/gui/guiGlobal.ml   10 Aug 2006 17:41:19 -0000      1.5
@@ -168,9 +168,9 @@
 open CommonTypes
 
 let check_usefull_source s =
-  let is_not_source = if s.source_files_requested = [] then true else false in
-  let is_not_friend = if client_browsed_tag land s.source_type = 0 then false 
else true in
-  let is_not_uploader = if source_only land s.source_has_upload = 1 then true 
else false in
+  let is_not_source = s.source_files_requested = [] in
+  let is_not_friend = not (client_browsed_tag land s.source_type = 0) in
+  let is_not_uploader = source_only land s.source_has_upload = 1 in
   if is_not_source && is_not_friend && is_not_uploader
     then (Hashtbl.remove sources s.source_num; false)
     else true

Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- src/networks/bittorrent/bTInteractive.ml    8 Aug 2006 11:27:57 -0000       
1.101
+++ src/networks/bittorrent/bTInteractive.ml    10 Aug 2006 17:41:20 -0000      
1.102
@@ -653,15 +653,8 @@
   ) ft_by_num
 
 let load_torrent_from_web r ft =
-  if !verbose then
-      lprintf_nl "Loading torrent from web";
   let module H = Http_client in
-
-  if !verbose then
-      lprintf_nl "calling...";
   H.wget r (fun filename ->
-      if !verbose then
-          lprintf_nl "done...";
       if ft_state ft = FileDownloading then begin
           load_torrent_file filename;
           file_cancel (as_ft ft)
@@ -681,7 +674,6 @@
   let location_regexp = "Location: \\(.*\\)" in
   try
     let real_url = get_regexp_string url (Str.regexp location_regexp) in
-    if !verbose then lprintf_nl "Loading %s, really %s" url real_url;
     if (valid_torrent_extension real_url)
        || (String2.contains url "Content-Type: application/x-bittorrent")
       then (
@@ -716,7 +708,6 @@
         let ft = new_ft file_diskname in
         ft.ft_retry <- load_torrent_from_web r ;
         load_torrent_from_web r ft;
-        if !verbose then lprintf_nl "wget started";
         "started download", true
       )
     else

Index: src/networks/fileTP/fileTPHTTP.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPHTTP.ml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- src/networks/fileTP/fileTPHTTP.ml   30 May 2006 10:54:14 -0000      1.24
+++ src/networks/fileTP/fileTPHTTP.ml   10 Aug 2006 17:41:20 -0000      1.25
@@ -333,10 +333,8 @@
 (*                CommonSwarming.free_range r; *)
                 d.download_ranges <- tail;
 (* If we have no more range to receive, disconnect *)
-                if d.download_ranges = [] then begin
-                  lprintf_nl "No more ranges";
+                if d.download_ranges = [] then
                   raise Exit;
-                end;
                 gconn.gconn_handler <- HttpHeader (client_parse_header c);
           end)
 
@@ -375,7 +373,6 @@
     } in
 
   H.whead2 r (fun headers ->
-      if !verbose then lprintf_nl "RECEIVED HEADERS";
       let content_length = ref None in
       List.iter (fun (name, content) ->
           if String.lowercase name = "content-length" then

Index: src/networks/fileTP/fileTPInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPInteractive.ml,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- src/networks/fileTP/fileTPInteractive.ml    6 Aug 2006 13:59:05 -0000       
1.42
+++ src/networks/fileTP/fileTPInteractive.ml    10 Aug 2006 17:41:20 -0000      
1.43
@@ -257,10 +257,8 @@
    bt-url-handler is called first. *)
 let is_http_torrent headers url =
   let ext = String.lowercase (Filename2.last_extension url) in
-  if ext = ".torrent" || ext = ".tor"
+  ext = ".torrent" || ext = ".tor"
      || (String2.contains headers "content-type application/x-bittorrent")
-    then true
-  else false
 
 let get_regexp_int text r =
   ignore (Str.search_forward r text 0);
@@ -281,9 +279,8 @@
 let op_network_parse_url url =
   let location_regexp = "Location: \\(.*\\)" in
   let real_url = get_regexp_string url (Str.regexp location_regexp) in
-  if !verbose then
-    lprintf_nl "real url: %s\n" real_url;
-  if (is_http_torrent url real_url) then "", false
+  if (is_http_torrent url real_url) && !!enable_bittorrent then
+    "this seems to be a torrent, ignoring...", false
   else
     if (String2.check_prefix real_url "http://";) then (
       let length_regexp = "Content-Length: \\(.*\\)" in
@@ -420,6 +417,7 @@
   );
   file_ops.op_file_resume <- (fun file -> ());
   file_ops.op_file_print_html <- (fun file buf -> ());
+  file_ops.op_file_print_sources_html <- (fun file buf -> ());
   network.op_network_close_search <- (fun s -> ());
   network.op_network_forget_search <- (fun s -> ());
   network.op_network_connect_servers <- (fun s -> ());

Index: src/networks/gnutella/gnutellaInteractive.ml
===================================================================
RCS file: 
/sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaInteractive.ml,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- src/networks/gnutella/gnutellaInteractive.ml        6 Aug 2006 13:59:05 
-0000       1.59
+++ src/networks/gnutella/gnutellaInteractive.ml        10 Aug 2006 17:41:20 
-0000      1.60
@@ -284,6 +284,8 @@
 module P = GuiTypes
   
 let _ =
+  file_ops.op_file_print_html <- (fun file buf -> ());
+  file_ops.op_file_print_sources_html <- (fun file buf -> ());
   file_ops.op_file_cancel <- (fun file ->
       CommonSwarming.remove_swarmer file.file_swarmer;
       file.file_swarmer <- None;

Index: src/utils/lib/autoconf.ml.new.in
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/autoconf.ml.new.in,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- src/utils/lib/autoconf.ml.new.in    12 May 2006 21:08:31 -0000      1.24
+++ src/utils/lib/autoconf.ml.new.in    10 Aug 2006 17:41:20 -0000      1.25
@@ -39,14 +39,14 @@
   if check_bounds && pos >= Array.length s then
     raise outofboundsaccess
 
-let has_iconv = if "@ICONV@" = "yes" then true else false
+let has_iconv = "@ICONV@" = "yes"
 
-let has_gd = if "@GD@" = "yes" then true else false
-let has_gd_png = if "@GD_PNG@" = "yes" then true else false
-let has_gd_jpg = if "@GD_JPG@" = "yes" then true else false
+let has_gd = "@GD@" = "yes"
+let has_gd_png = "@GD_PNG@" = "yes"
+let has_gd_jpg = "@GD_JPG@" = "yes"
 
-let bzip2 = if "@BZIP2@" = "yes" then true else false
-let magic = if "@MAGIC@" = "yes" then true else false
+let bzip2 = "@BZIP2@" = "yes"
+let magic = "@MAGIC@" = "yes"
 let magic_works = ref false
 
 let zlib__uncompress_string2 s = Zlib.uncompress_string2 s




reply via email to

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