From deff14dfd81313900949bb97f58580269f2b9453 Mon Sep 17 00:00:00 2001 From: jrandom Date: Sun, 13 Jun 2004 20:27:44 +0000 Subject: [PATCH] lets see if this fixes bug 66 (http://dev.i2p.net/bugzilla/show_bug.cgi?id=66) --- .../net/i2p/router/transport/TrivialBandwidthLimiter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/TrivialBandwidthLimiter.java b/router/java/src/net/i2p/router/transport/TrivialBandwidthLimiter.java index 7b3774d69..99fa83781 100644 --- a/router/java/src/net/i2p/router/transport/TrivialBandwidthLimiter.java +++ b/router/java/src/net/i2p/router/transport/TrivialBandwidthLimiter.java @@ -146,7 +146,8 @@ public class TrivialBandwidthLimiter extends BandwidthLimiter { * Note that numBytes have been read from the peer */ public void consumeInbound(RouterIdentity peer, int numBytes) { - _totalInboundBytes += numBytes; + if (numBytes > 0) + _totalInboundBytes += numBytes; if (_inboundKBytesPerSecond > 0) _inboundAvailable -= numBytes; } @@ -155,7 +156,8 @@ public class TrivialBandwidthLimiter extends BandwidthLimiter { * Note that numBytes have been sent to the peer */ public void consumeOutbound(RouterIdentity peer, int numBytes) { - _totalOutboundBytes += numBytes; + if (numBytes > 0) + _totalOutboundBytes += numBytes; if (_outboundKBytesPerSecond > 0) _outboundAvailable -= numBytes; }