Fix a bug in AbstractTrafficShapingHandler.getTimeToWait() where it doesn't work OK when system time goes back.
This commit is contained in:
parent
08ec96e4f4
commit
8ded23fba5
@ -334,14 +334,11 @@ public abstract class AbstractTrafficShapingHandler extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @return the time that should be necessary to wait to respect limit. Can be negative time
|
||||||
* @return the time that should be necessary to wait to respect limit. Can
|
*/
|
||||||
* be negative time
|
private static long getTimeToWait(long limit, long bytes, long lastTime, long curtime) {
|
||||||
*/
|
|
||||||
private static long getTimeToWait(long limit, long bytes, long lastTime,
|
|
||||||
long curtime) {
|
|
||||||
long interval = curtime - lastTime;
|
long interval = curtime - lastTime;
|
||||||
if (interval == 0) {
|
if (interval <= 0) {
|
||||||
// Time is too short, so just lets continue
|
// Time is too short, so just lets continue
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user