mirror of
https://github.com/nmap/nmap.git
synced 2026-02-04 04:26:33 +00:00
Use std::multiset to keep script outputs in order instead of sorting.
This commit is contained in:
12
portlist.cc
12
portlist.cc
@@ -116,10 +116,12 @@ void Port::freeService(bool del_service) {
|
||||
void Port::freeScriptResults(void)
|
||||
{
|
||||
#ifndef NOLUA
|
||||
while (!scriptResults.empty()) {
|
||||
scriptResults.front().clear();
|
||||
scriptResults.pop_front();
|
||||
}
|
||||
for (ScriptResults::iterator it = scriptResults.begin();
|
||||
it != scriptResults.end(); it++) {
|
||||
ScriptResult sr = *it;
|
||||
sr.clear();
|
||||
}
|
||||
scriptResults.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -377,7 +379,7 @@ void PortList::addScriptResult(u16 portno, int protocol, const ScriptResult& sr)
|
||||
|
||||
port = createPort(portno, protocol);
|
||||
|
||||
port->scriptResults.push_back(sr);
|
||||
port->scriptResults.insert(sr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user