Fix for first issue from #1652 on computation of time to wait in AbstractTrafficShapingHandler for Netty 4

Fix for first issue from #1652 on computation of time to wait in AbstractTrafficShapingHandler for Netty 4, using the same formula than in Netty 3 (wrong place for parenthese).
Was:

    (bytes * 1000 / limit - interval / 10) * 10;

Becomes:

    (bytes * 1000 / limit - interval) / 10 * 10;
This commit is contained in:
Frédéric Brégier 2013-07-25 15:19:42 +02:00 committed by Norman Maurer
parent 15279b2525
commit 61b1214b24

View File

@ -205,7 +205,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
// Time is too short, so just lets continue
return 0;
}
return (bytes * 1000 / limit - interval / 10) * 10;
return (bytes * 1000 / limit - interval) / 10 * 10;
}
@Override