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:
@@ -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 we've tried this server enough times, move to the next one
|
||||||
if (read_timeouts[read_timeout_index][tpreq->tries] == -1) {
|
if (read_timeouts[read_timeout_index][tpreq->tries] == -1) {
|
||||||
if (!adjusted) {
|
if (!adjusted && tpreq->servers_tried == 0) {
|
||||||
servI->max_capacity = servI->capacity * 2;
|
servI->max_capacity = servI->capacity * 2;
|
||||||
servI->capacity = (int) (servI->capacity * CAPACITY_MAJOR_DOWN_SCALE);
|
servI->capacity = (int) (servI->capacity * CAPACITY_MAJOR_DOWN_SCALE);
|
||||||
check_capacities(&*servI);
|
check_capacities(&*servI);
|
||||||
@@ -620,7 +620,7 @@ static int deal_with_timedout_reads(bool adjust_timing) {
|
|||||||
servItemp->to_process.push_back(tpreq);
|
servItemp->to_process.push_back(tpreq);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!adjusted) {
|
if (!adjusted && tpreq->servers_tried == 0 && tpreq->tries <= 1) {
|
||||||
servI->max_capacity = servI->capacity * 4;
|
servI->max_capacity = servI->capacity * 4;
|
||||||
servI->capacity = (int) (servI->capacity * CAPACITY_MINOR_DOWN_SCALE);
|
servI->capacity = (int) (servI->capacity * CAPACITY_MINOR_DOWN_SCALE);
|
||||||
check_capacities(&*servI);
|
check_capacities(&*servI);
|
||||||
|
|||||||
Reference in New Issue
Block a user