From dd2db79896126dfe9c62071210b9b97235006aac Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 9 Jan 2012 14:13:24 +0000 Subject: [PATCH] fix overflow bug in progress_ppm field --- ChangeLog | 1 + src/peer_connection.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fc5f5d0e6..d885ebd69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -101,6 +101,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fix overflow bug in progress_ppm field * don't filter local peers received from a non-local tracker * fix python deadlock when using python extensions * fixed small memory leak in DHT diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 825bbc372..6b7afe545 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -3824,7 +3824,7 @@ namespace libtorrent #else p.progress = (float)p.pieces.count() / (float)p.pieces.size(); #endif - p.progress_ppm = p.pieces.count() * 1000000 / p.pieces.size(); + p.progress_ppm = boost::uint64_t(p.pieces.count()) * 1000000 / p.pieces.size(); } p.estimated_reciprocation_rate = m_est_reciprocation_rate;