forgotten file

This commit is contained in:
Pieter Wuille 2011-12-26 18:27:02 +01:00
parent f7ce03cf70
commit 54efe5f9d0
3 changed files with 22 additions and 1 deletions

1
db.cpp
View file

@ -67,6 +67,7 @@ bool CAddrDb::Get_(CIPPort &ip, int &wait) {
}
if (idToInfo[ret].ignoreTill && idToInfo[ret].ignoreTill < now) {
ourId.push_back(ret);
idToInfo[ret].ourLastTry = now;
} else {
ip = idToInfo[ret].ip;
break;

20
dns.h Normal file
View file

@ -0,0 +1,20 @@
#ifndef _DNS_H_
#define _DNS_H_ 1
#include <stdint.h>
typedef struct {
int port;
int datattl;
int nsttl;
const char *host;
const char *ns;
const char *mbox;
int (*cb)(struct in_addr *addr, int max, int ipv4only);
// stats
uint64_t nRequests;
} dns_opt_t;
extern int dnsserver(dns_opt_t *opt);
#endif

View file

@ -88,7 +88,7 @@ extern "C" void* ThreadStats(void*) {
CAddrDbStats stats;
db.GetStats(stats);
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
printf("*** %i available (%i tracked (%is old), %i new, %i active), %i banned; %i good; %llu DNS requests", stats.nAvail, stats.nTracked, stats.nAge, stats.nNew, stats.nAvail - stats.nTracked - stats.nNew, stats.nBanned, stats.nGood, (unsigned long long)dns_opt.nRequests);
printf("*** %i/%i available (%i tried in %is, %i new, %i active), %i banned; %llu DNS requests", stats.nGood, stats.nAvail, stats.nTracked, stats.nAge, stats.nNew, stats.nAvail - stats.nTracked - stats.nNew, stats.nBanned, (unsigned long long)dns_opt.nRequests);
Sleep(1000);
} while(1);
}