mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] Changes to mldonkey/src/utils/net/tcpBufferedSocket.m


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/utils/net/tcpBufferedSocket.ml
Date: Sun, 16 Oct 2005 16:43:48 -0400

Index: mldonkey/src/utils/net/tcpBufferedSocket.ml
diff -u mldonkey/src/utils/net/tcpBufferedSocket.ml:1.35 
mldonkey/src/utils/net/tcpBufferedSocket.ml:1.36
--- mldonkey/src/utils/net/tcpBufferedSocket.ml:1.35    Mon Sep 19 10:09:06 2005
+++ mldonkey/src/utils/net/tcpBufferedSocket.ml Sun Oct 16 20:42:55 2005
@@ -553,12 +553,11 @@
 (*          if t.monitored then begin
               lprintf "write: direct written %d\n" nw;
 end; *)
-          tcp_uploaded_bytes := Int64.add !tcp_uploaded_bytes (Int64.of_int 
nw);
+          tcp_uploaded_bytes := !tcp_uploaded_bytes ++ (Int64.of_int nw);
           (match t.write_control with
               None -> ()
             | Some bc ->
-                bc.moved_bytes <-
-                  Int64.add bc.moved_bytes (Int64.of_int nw));
+                bc.moved_bytes <- bc.moved_bytes ++ (Int64.of_int nw));
           if t.nwrite = 0 then begin
 (*              if t.connecting then
                 lprintf "WRITE BEFORE CONNECTION.......\n";
@@ -698,11 +697,10 @@
     end;
 *)
 
-    tcp_downloaded_bytes := Int64.add !tcp_downloaded_bytes (Int64.of_int 
nread);
+    tcp_downloaded_bytes := !tcp_downloaded_bytes ++ (Int64.of_int nread);
     (match t.read_control with
         None -> () | Some bc ->
-          bc.moved_bytes <-
-          Int64.add bc.moved_bytes (Int64.of_int nread));
+          bc.moved_bytes <- bc.moved_bytes ++ (Int64.of_int nread));
 
     t.nread <- t.nread + nread;
     if nread > 0 then begin
@@ -755,12 +753,11 @@
 
 (*            if t.monitored then
 (lprintf "written %d\n" nw; ); *)
-        tcp_uploaded_bytes := Int64.add !tcp_uploaded_bytes (Int64.of_int nw);
+        tcp_uploaded_bytes := !tcp_uploaded_bytes ++ (Int64.of_int nw);
         (match t.write_control with
             None -> ()
           | Some bc ->
-              bc.moved_bytes <-
-                    Int64.add bc.moved_bytes (Int64.of_int nw));
+              bc.moved_bytes <- bc.moved_bytes ++ (Int64.of_int nw));
             if t.nwrite = 0 then begin
 (*                lprintf "add_connect_latency at %f\n" (current_time ()); *)
                 add_connect_latency t.host t.connect_time;
@@ -960,9 +957,9 @@
   if bc.total_bytes = 0 then -1 else
   let sum = ref Int64.zero in
   for i = 0 to 3600-1 do
-    sum := Int64.add !sum (Int64.of_int bc.lost_bytes.(i));
+    sum := !sum ++ (Int64.of_int bc.lost_bytes.(i));
   done;
-  Int64.to_int (Int64.div !sum (Int64.of_int 3600))
+  Int64.to_int (!sum // 3600L)
 
 let moved_bytes bc = bc.moved_bytes
 




reply via email to

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