@ -143,7 +143,8 @@ extern "C" void* ThreadCrawler(void* data) {
res . nClientV = 0 ;
res . nClientV = 0 ;
res . nHeight = 0 ;
res . nHeight = 0 ;
res . strClientV = " " ;
res . strClientV = " " ;
bool getaddr = res . ourLastSuccess + 604800 < now ;
//bool getaddr = res.ourLastSuccess + 604800 < now;
bool getaddr = true ; // [MF] always getaddr
res . fGood = TestNode ( res . service , res . nBanTime , res . nClientV , res . strClientV , res . nHeight , getaddr ? & addr : NULL ) ;
res . fGood = TestNode ( res . service , res . nBanTime , res . nClientV , res . strClientV , res . nHeight , getaddr ? & addr : NULL ) ;
}
}
db . ResultMany ( ips ) ;
db . ResultMany ( ips ) ;
@ -232,6 +233,7 @@ extern "C" int GetIPList(void *data, addr_t* addr, int max, int ipv4, int ipv6)
thread - > cacheHit ( ) ;
thread - > cacheHit ( ) ;
unsigned int size = thread - > cache . size ( ) ;
unsigned int size = thread - > cache . size ( ) ;
unsigned int maxmax = ( ipv4 ? thread - > nIPv4 : 0 ) + ( ipv6 ? thread - > nIPv6 : 0 ) ;
unsigned int maxmax = ( ipv4 ? thread - > nIPv4 : 0 ) + ( ipv6 ? thread - > nIPv6 : 0 ) ;
if ( max > size )
if ( max > size )
max = size ;
max = size ;
if ( max > maxmax )
if ( max > maxmax )
@ -320,6 +322,7 @@ extern "C" void* ThreadStats(void*) {
strftime ( c , 256 , " [%y-%m-%d %H:%M:%S] " , tmp ) ;
strftime ( c , 256 , " [%y-%m-%d %H:%M:%S] " , tmp ) ;
CAddrDbStats stats ;
CAddrDbStats stats ;
db . GetStats ( stats ) ;
db . GetStats ( stats ) ;
/*
if ( first )
if ( first )
{
{
first = false ;
first = false ;
@ -328,13 +331,14 @@ extern "C" void* ThreadStats(void*) {
else
else
printf ( " \x1b [2K \x1b [u " ) ;
printf ( " \x1b [2K \x1b [u " ) ;
printf ( " \x1b [s " ) ;
printf ( " \x1b [s " ) ;
*/
uint64_t requests = 0 ;
uint64_t requests = 0 ;
uint64_t queries = 0 ;
uint64_t queries = 0 ;
for ( unsigned int i = 0 ; i < dnsThread . size ( ) ; i + + ) {
for ( unsigned int i = 0 ; i < dnsThread . size ( ) ; i + + ) {
requests + = dnsThread [ i ] - > dns_opt . nRequests ;
requests + = dnsThread [ i ] - > dns_opt . nRequests ;
queries + = dnsThread [ i ] - > dbQueries ;
queries + = dnsThread [ i ] - > dbQueries ;
}
}
printf ( " %s %i/%i available (%i tried in %is, %i new, %i active), %i banned; %llu DNS requests, %llu db queries " , c , stats . nGood , stats . nAvail , stats . nTracked , stats . nAge , stats . nNew , stats . nAvail - stats . nTracked - stats . nNew , stats . nBanned , ( unsigned long long ) requests , ( unsigned long long ) queries ) ;
printf ( " %s %i/%i available (%i tried in %is, %i new, %i active), %i banned; %llu DNS requests, %llu db queries \n " , c , stats . nGood , stats . nAvail , stats . nTracked , stats . nAge , stats . nNew , stats . nAvail - stats . nTracked - stats . nNew , stats . nBanned , ( unsigned long long ) requests , ( unsigned long long ) queries ) ;
Sleep ( 1000 ) ;
Sleep ( 1000 ) ;
} while ( 1 ) ;
} while ( 1 ) ;
}
}