From: Shravan Rangarajuvenkata (shrarang) Date: Mon, 25 Jan 2021 18:32:36 +0000 (+0000) Subject: Merge pull request #2713 in SNORT/snort3 from ~SATHIRKA/snort3:reload_response to... X-Git-Tag: 3.1.1.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08040ce90296c72904ed8251de3ae04f9fdc00cb;p=thirdparty%2Fsnort3.git Merge pull request #2713 in SNORT/snort3 from ~SATHIRKA/snort3:reload_response to master Squashed commit of the following: commit ab0f7d9e35572f611a339eb4ff7ddeeeb8b3c547 Author: Sreeja Athirkandathil Narayanan Date: Fri Jan 8 11:19:29 2021 -0500 appid: Send reload detectors and third-party messages to socket immediately if appid is not enabled --- diff --git a/src/network_inspectors/appid/appid_module.cc b/src/network_inspectors/appid/appid_module.cc index 4ce78cd0e..37e448965 100644 --- a/src/network_inspectors/appid/appid_module.cc +++ b/src/network_inspectors/appid/appid_module.cc @@ -312,28 +312,28 @@ static int disable_debug(lua_State*) static int reload_third_party(lua_State* L) { - bool from_shell = ( L != nullptr ); SharedRequest current_request = get_current_request(); if (Swapper::get_reload_in_progress()) { - current_request->respond("== reload pending; retry\n", from_shell); + current_request->respond("== reload pending; retry\n"); return 0; } - current_request->respond(".. reloading third-party\n", from_shell); AppIdInspector* inspector = (AppIdInspector*) InspectorManager::get_inspector(MOD_NAME); if (!inspector) { - current_request->respond("== reload third-party failed - appid not enabled\n", from_shell); + current_request->respond("== reload third-party failed - appid not enabled\n"); return 0; } const AppIdContext& ctxt = inspector->get_ctxt(); ThirdPartyAppIdContext* old_ctxt = ctxt.get_tp_appid_ctxt(); if (!old_ctxt) { - current_request->respond("== reload third-party failed - third-party module doesn't exist\n", from_shell); + current_request->respond("== reload third-party failed - third-party module doesn't exist\n"); return 0; } Swapper::set_reload_in_progress(true); + + bool from_shell = ( L != nullptr ); current_request->respond("== unloading old third-party configuration\n", from_shell); main_broadcast_command(new ACThirdPartyAppIdContextUnload(*inspector, old_ctxt, current_request, from_shell), from_shell); @@ -351,21 +351,21 @@ static void clear_dynamic_host_cache_services() static int reload_detectors(lua_State* L) { - bool from_shell = ( L != nullptr ); SharedRequest current_request = get_current_request(); if (Swapper::get_reload_in_progress()) { - current_request->respond("== reload pending; retry\n", from_shell); + current_request->respond("== reload pending; retry\n"); return 0; } - current_request->respond(".. reloading detectors\n", from_shell); AppIdInspector* inspector = (AppIdInspector*) InspectorManager::get_inspector(MOD_NAME); if (!inspector) { - current_request->respond("== reload detectors failed - appid not enabled\n", from_shell); + current_request->respond("== reload detectors failed - appid not enabled\n"); return 0; } Swapper::set_reload_in_progress(true); + bool from_shell = ( L != nullptr ); + current_request->respond(".. reloading detectors\n", from_shell); AppIdContext& ctxt = inspector->get_ctxt(); OdpContext& old_odp_ctxt = ctxt.get_odp_ctxt();