mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 21:51:28 +00:00
Merge from /nmap-exp/david/nmap-mem. This brings in two memory-reducing
changes. The first is that Port objects don't allocate memory for service and RPC results unless that information is set. This reduces the size of a bare Port from 92 to 40 bytes on my machine. The second change is that PortList now has the notion of a "default port state," which is the state of any ports that didn't receive a response. These ports don't need an allocated Port object, which saves a lot of memory in scans where most ports didn't get a response.
This commit is contained in:
@@ -361,7 +361,7 @@ static int rpc_are_we_done(char *msg, int msg_len, Target *target,
|
||||
|
||||
if (rsi->rpc_current_port->state == PORT_OPENFILTERED) {
|
||||
/* Received a packet, so this port is actually open */
|
||||
target->ports.addPort(rsi->rpc_current_port->portno,
|
||||
target->ports.setPortState(rsi->rpc_current_port->portno,
|
||||
rsi->rpc_current_port->proto, PORT_OPEN);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user