]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4424: appid: logs added around third party reload
authorBhumika Sachdeva (bsachdev) <bsachdev@cisco.com>
Fri, 30 Aug 2024 19:40:10 +0000 (19:40 +0000)
committerChris Sherwin (chsherwi) <chsherwi@cisco.com>
Fri, 30 Aug 2024 19:40:10 +0000 (19:40 +0000)
Merge in SNORT/snort3 from ~BSACHDEV/snort3:tp_fix_logs to master

Squashed commit of the following:

commit b113ad653effd50f9021dbb62371be1f457b2176
Author: bsachdev <bsachdev@cisco.com>
Date:   Tue Aug 13 16:32:29 2024 -0400

    appid: added new logs for reload third party

src/control/control.cc
src/network_inspectors/appid/appid_module.cc

index 8b5100c0b4b3b2f853aac5c785679be98abcb762..6d42e7632dd44a6275b72c4541839f70764cc7ea 100644 (file)
@@ -240,6 +240,7 @@ bool ControlConn::respond(const char* format, va_list& ap)
             if (errno != EAGAIN && errno != EINTR)
             {
                 shutdown();
+                ErrorMessage("ControlConn: Error in writing response, closing the connection: %s\n", get_error(errno));
                 return false;
             }
         }
@@ -248,7 +249,6 @@ bool ControlConn::respond(const char* format, va_list& ap)
     }
 
     touch();
-
     return true;
 }
 
index 45f2e71e710e7a2236ea856e1d8013256433bb1b..371d0361bb1cdba4abe96fb025065e894eaa9074 100644 (file)
@@ -177,7 +177,7 @@ bool ACThirdPartyAppIdContextSwap::execute(Analyzer&, void**)
     pkt_thread_tp_appid_ctxt = inspector.get_ctxt().get_tp_appid_ctxt();
     pkt_thread_tp_appid_ctxt->tinit();
     ThirdPartyAppIdContext::set_tp_reload_in_progress(false);
-
+    appid_log(nullptr, TRACE_INFO_LEVEL, "== third-party context swap in progress\n");
     return true;
 }
 
@@ -214,10 +214,14 @@ bool ACThirdPartyAppIdContextUnload::execute(Analyzer& ac, void**)
         reload_in_progress = pkt_thread_tp_appid_ctxt->tfini(true);
     else
         reload_in_progress = pkt_thread_tp_appid_ctxt->tfini();
-    if (reload_in_progress)
+
+    if (reload_in_progress) {
+        appid_log(nullptr, TRACE_INFO_LEVEL, "== rescheduling third-party context unload\n");
         return false;
+    }
     pkt_thread_tp_appid_ctxt = nullptr;
 
+    appid_log(nullptr, TRACE_INFO_LEVEL, "== third-party context unload in progress\n");
     return true;
 }