#include "host_tracker/host_cache.h"
#include "log/messages.h"
+#include "main/analyzer.h"
#include "main/analyzer_command.h"
#include "main/snort.h"
#include "main/swapper.h"
bool from_shell;
};
-bool ACThirdPartyAppIdContextUnload::execute(Analyzer&, void**)
+bool ACThirdPartyAppIdContextUnload::execute(Analyzer& ac, void**)
{
assert(pkt_thread_tp_appid_ctxt);
pkt_thread_tp_appid_ctxt->set_tp_reload_in_progress(true);
- bool reload_in_progress = pkt_thread_tp_appid_ctxt->tfini(true);
+ bool reload_in_progress;
+ if (ac.is_idling())
+ reload_in_progress = pkt_thread_tp_appid_ctxt->tfini(true, true);
+ else
+ reload_in_progress = pkt_thread_tp_appid_ctxt->tfini(true);
if (reload_in_progress)
return false;
pkt_thread_tp_appid_ctxt = nullptr;
}
int tinit() override { return 0; }
- bool tfini(bool) override { return false; }
+ bool tfini(bool, bool) override { return false; }
};
class ThirdPartyAppIdSessionImpl : public ThirdPartyAppIdSession
const std::string& module_name() const { return name; }
virtual int tinit() = 0;
- virtual bool tfini(bool reload = false) = 0;
+ virtual bool tfini(bool reload = false, bool is_idling = false) = 0;
virtual const ThirdPartyConfig& get_config() const { return cfg; }