Open ncanceill opened 11 years ago
Seems it comes from a side-effect of lazy evaluation in the add_block_hash()
function, because an additional query is sent to the bloom filter in order to check for previous appearance.
if(opt_raw && b.query(md5.digest)){
cout << "Input file block " << blocknumber << "appears previously at ";;
for(blocklist_t::const_iterator i = this->md5map[md5].begin();
i!=this->md5map[md5].end();
i++){
printf("%"PRId64" ",*i);
}
printf("\n");
}
Side-effect occurs in the nsrl_bloom_query()
function because it increments hits
upon each query.
/* All of the bits were set; hash must be in the bloom filter */
if(b->debug>1) putchar('\n');
b->hits++;
Extending API by pseudo-overloading seems to work, waiting for simsong/frag_find#1 to be pulled first.
print_report()
has side-effect onmasters_t::NSRLBloom
.-r
option, and witness the "Total number of bloom filter hits" output change; the-r
option triggers an additional call to(*t)->print_report(0,blocksize)
.Working on it atm, standby...