This commit is contained in:
jrandom
2004-06-13 20:27:44 +00:00
committed by zzz
parent 0a479be370
commit deff14dfd8

View File

@ -146,6 +146,7 @@ public class TrivialBandwidthLimiter extends BandwidthLimiter {
* Note that numBytes have been read from the peer
*/
public void consumeInbound(RouterIdentity peer, int numBytes) {
if (numBytes > 0)
_totalInboundBytes += numBytes;
if (_inboundKBytesPerSecond > 0)
_inboundAvailable -= numBytes;
@ -155,6 +156,7 @@ public class TrivialBandwidthLimiter extends BandwidthLimiter {
* Note that numBytes have been sent to the peer
*/
public void consumeOutbound(RouterIdentity peer, int numBytes) {
if (numBytes > 0)
_totalOutboundBytes += numBytes;
if (_outboundKBytesPerSecond > 0)
_outboundAvailable -= numBytes;