Browse Source

forgotten file

pull/1/head
Pieter Wuille 13 years ago
parent
commit
54efe5f9d0
  1. 1
      db.cpp
  2. 20
      dns.h
  3. 2
      main.cpp

1
db.cpp

@ -67,6 +67,7 @@ bool CAddrDb::Get_(CIPPort &ip, int &wait) { @@ -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

@ -0,0 +1,20 @@ @@ -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

2
main.cpp

@ -88,7 +88,7 @@ extern "C" void* ThreadStats(void*) { @@ -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);
}

Loading…
Cancel
Save