Skip to content

Commit

Permalink
Erase by key
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Apr 18, 2024
1 parent 1bb2703 commit 22ee545
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nmap_dns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@ static int deal_with_timedout_reads() {
servI->capacity = (int) (servI->capacity * CAPACITY_MINOR_DOWN_SCALE);
check_capacities(&*servI);
servI->in_process.erase(reqI);
std::map<u16, info>::iterator it = records.find(tpreq->id);
if ( it != records.end() )
records.erase(it);
records.erase(tpreq->id);
servI->reqs_on_wire--;

// If we've tried this server enough times, move to the next one
Expand Down Expand Up @@ -558,9 +556,7 @@ static int deal_with_timedout_reads() {
output_summary();
stat_dropped++;
total_reqs--;
infoI = records.find(tpreq->id);
if ( infoI != records.end() )
records.erase(infoI);
records.erase(tpreq->id);
delete tpreq;

// **** OR We start at the back of this server's queue
Expand Down

0 comments on commit 22ee545

Please sign in to comment.