The following diff fixes the display of the upload/download speed.
ktorrent doesn't like the time going into the future which is possible
if running ntpd.


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/ktorrent/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile    15 Sep 2007 22:36:54 -0000      1.2
+++ Makefile    5 Nov 2007 06:12:31 -0000
@@ -6,6 +6,7 @@ COMMENT=        BitTorrent client for KDE
 
 VERSION=       2.1.4
 DISTNAME=      ktorrent-${VERSION}
+PKGNAME=       ${DISTNAME}p0
 CATEGORIES=    net x11 x11/kde
 MASTER_SITES=  ${HOMEPAGE}downloads/${VERSION}/
 
Index: patches/patch-libktorrent_net_speed_cpp
===================================================================
RCS file: patches/patch-libktorrent_net_speed_cpp
diff -N patches/patch-libktorrent_net_speed_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libktorrent_net_speed_cpp     5 Nov 2007 23:13:44 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- libktorrent/net/speed.cpp.orig     Mon Nov  5 18:12:45 2007
++++ libktorrent/net/speed.cpp  Mon Nov  5 18:13:31 2007
+@@ -47,7 +47,7 @@ namespace net
+               while (i != dlrate.end())
+               {
+                       QPair<Uint32,TimeStamp> & p = *i;
+-                      if (now - p.second > SPEED_INTERVAL)
++                      if (now - p.second > SPEED_INTERVAL || now < p.second)
+                       {
+                               if (bytes >= p.first) // make sure we don't 
wrap around
+                                       bytes -= p.first; // subtract bytes

Reply via email to