Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5705219
)
ratequeue: Handle bucket emptying more correctly.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 6 Feb 2022 17:14:30 +0000
(18:14 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 6 Feb 2022 17:14:30 +0000
(18:14 +0100)
src/ratequeue.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ratequeue.c
b/src/ratequeue.c
index
dc7e198
..
6d654c9
100644
(file)
--- a/
src/ratequeue.c
+++ b/
src/ratequeue.c
@@
-316,9
+316,9
@@
static void tickbucket(struct bucket *bk)
bk->last = now;
ll = bk->level;
if((bk->level -= delta * cf.rate) < 0) {
- bk->level = 0;
if(ll > 0)
- bk->etime = now;
+ bk->etime = now + (bk->level / cf.rate);
+ bk->level = 0;
}
while((bk->brim.d > 0) && (bk->level < cf.size)) {
if(sendreq(child, bk->brim.b[0].req, bk->brim.b[0].fd)) {