Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python3: Encode ashd-wsgi3 output headers with utf-8 instead of latin-1.
[ashd.git]
/
src
/
ratequeue.c
diff --git
a/src/ratequeue.c
b/src/ratequeue.c
index
dc7e198
..
21d6ec3
100644
(file)
--- a/
src/ratequeue.c
+++ b/
src/ratequeue.c
@@
-25,6
+25,8
@@
#include <signal.h>
#include <assert.h>
#include <sys/poll.h>
#include <signal.h>
#include <assert.h>
#include <sys/poll.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef HAVE_CONFIG_H
#include <arpa/inet.h>
#ifdef HAVE_CONFIG_H
@@
-151,7
+153,7
@@
static const char *formatsrc(const struct source *src)
static void rehash(int nlen)
{
static void rehash(int nlen)
{
- int i, o, n, m, pl, nl;
+
unsigned
int i, o, n, m, pl, nl;
struct bucket **new, **old;
old = buckets;
struct bucket **new, **old;
old = buckets;
@@
-316,9
+318,9
@@
static void tickbucket(struct bucket *bk)
bk->last = now;
ll = bk->level;
if((bk->level -= delta * cf.rate) < 0) {
bk->last = now;
ll = bk->level;
if((bk->level -= delta * cf.rate) < 0) {
- bk->level = 0;
if(ll > 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)) {
}
while((bk->brim.d > 0) && (bk->level < cf.size)) {
if(sendreq(child, bk->brim.b[0].req, bk->brim.b[0].fd)) {