[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/utils/lib/unix32.ml
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/utils/lib/unix32.ml |
Date: |
Tue, 11 Oct 2005 13:25:24 -0400 |
Index: mldonkey/src/utils/lib/unix32.ml
diff -u mldonkey/src/utils/lib/unix32.ml:1.47
mldonkey/src/utils/lib/unix32.ml:1.48
--- mldonkey/src/utils/lib/unix32.ml:1.47 Mon Oct 10 16:22:25 2005
+++ mldonkey/src/utils/lib/unix32.ml Tue Oct 11 17:25:22 2005
@@ -481,10 +481,14 @@
Unix2.remove_all_directory t.dirname
let file_write file in_file_pos s in_string_pos len =
- let len64 = Int64.of_int len in
- let in_file_len = in_file_pos ++ len64 in
- FDCache.write file.fd in_file_pos s in_string_pos len;
- file.current_len <- max file.current_len in_file_len
+ (* prevent write to zero-byte files so BT downloads finish *)
+ if len <> 0 then
+ begin
+ let len64 = Int64.of_int len in
+ let in_file_len = in_file_pos ++ len64 in
+ FDCache.write file.fd in_file_pos s in_string_pos len;
+ file.current_len <- max file.current_len in_file_len
+ end
let file_read file in_file_pos s in_string_pos len =
let len64 = Int64.of_int len in