[packages] tor-alpha: update to 0.2.2.22-alpha, add archive mirror
[openwrt/svn-archive/archive.git] / net / djbdns / patches / 040-dnscache-less-chatty-log.patch
1 --- a/log.h
2 +++ b/log.h
3 @@ -1,6 +1,8 @@
4 #ifndef LOG_H
5 #define LOG_H
6
7 +#define STATS_DISPLAY_INTERVAL 5
8 +
9 #include "uint64.h"
10
11 extern void log_startup(void);
12 --- a/log.c
13 +++ b/log.c
14 @@ -1,6 +1,7 @@
15 #include "buffer.h"
16 #include "uint32.h"
17 #include "uint16.h"
18 +#include "time.h"
19 #include "error.h"
20 #include "byte.h"
21 #include "log.h"
22 @@ -274,11 +275,17 @@ void log_rrsoa(const char server[4],cons
23
24 void log_stats(void)
25 {
26 + static time_t prev = 0;
27 + time_t cur = time(NULL);
28 extern uint64 numqueries;
29 extern uint64 cache_motion;
30 extern int uactive;
31 extern int tactive;
32
33 + if(prev == 0) prev = time(NULL);
34 + if(cur - prev < STATS_DISPLAY_INTERVAL) return;
35 + prev = cur;
36 +
37 string("stats ");
38 number(numqueries); space();
39 number(cache_motion); space();