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

Avoid copying script results; store pointers instead.

This commit is contained in:
dmiller
2021-04-29 17:52:24 +00:00
parent c3a2faaa7b
commit f17fa67008
7 changed files with 38 additions and 34 deletions

View File

@@ -22,6 +22,10 @@ class ScriptResult
ScriptResult() {
output_ref = LUA_NOREF;
}
~ScriptResult() {
// ensures Lua ref is released
clear();
}
void clear (void);
void set_output_tab (lua_State *, int);
void set_output_str (const char *);
@@ -35,7 +39,7 @@ class ScriptResult
}
};
typedef std::multiset<ScriptResult> ScriptResults;
typedef std::multiset<ScriptResult *> ScriptResults;
/* Call this to get a ScriptResults object which can be
* used to store Pre-Scan and Post-Scan script Results */