1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

mass_dns: only scale back for initial requests

Some requests just take longer; they may have lots of recursion or a
slow authoritative server. That won't change on retransmissions, so if
we treat all requests and retransmissions equally, we get a long tail of
retransmits with smaller and smaller capacity (parallelism). Instead, we
will use the initial-request period to determine server capacity and
then not change it during the retransmit phase.
This commit is contained in:
dmiller
2024-05-16 19:31:45 +00:00
parent 8b8c6fca4e
commit 50ceac5753

View File

@@ -582,7 +582,7 @@ static int deal_with_timedout_reads(bool adjust_timing) {
// If we've tried this server enough times, move to the next one
if (read_timeouts[read_timeout_index][tpreq->tries] == -1) {
if (!adjusted) {
if (!adjusted && tpreq->servers_tried == 0) {
servI->max_capacity = servI->capacity * 2;
servI->capacity = (int) (servI->capacity * CAPACITY_MAJOR_DOWN_SCALE);
check_capacities(&*servI);
@@ -620,7 +620,7 @@ static int deal_with_timedout_reads(bool adjust_timing) {
servItemp->to_process.push_back(tpreq);
}
} else {
if (!adjusted) {
if (!adjusted && tpreq->servers_tried == 0 && tpreq->tries <= 1) {
servI->max_capacity = servI->capacity * 4;
servI->capacity = (int) (servI->capacity * CAPACITY_MINOR_DOWN_SCALE);
check_capacities(&*servI);