]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4544: appid: Extended error log in controlcon.
authorVitalii Izhyk -X (viizhyk - SOFTSERVE INC at Cisco) <viizhyk@cisco.com>
Fri, 13 Dec 2024 15:42:42 +0000 (15:42 +0000)
committerChris Sherwin (chsherwi) <chsherwi@cisco.com>
Fri, 13 Dec 2024 15:42:42 +0000 (15:42 +0000)
Merge in SNORT/snort3 from ~VIIZHYK/snort3:controlcon_log to master

Squashed commit of the following:

commit 8fde0b7a2381b41adc6b07b9b8378be7b342d227
Author: viizhyk <viizhyk@cisco.com>
Date:   Fri Dec 13 04:39:48 2024 -0500

    appid: Enhanced control error message with additional info.

src/control/control.cc

index 6d42e7632dd44a6275b72c4541839f70764cc7ea..80ef8dca5e7b606802bf3bfb7721ad800961f27f 100644 (file)
@@ -223,6 +223,9 @@ bool ControlConn::show_prompt()
 
 bool ControlConn::respond(const char* format, va_list& ap)
 {
+    if (is_closed() or is_removed())
+        return false;
+
     char buf[STD_BUF];
     int response_len = vsnprintf(buf, sizeof(buf), format, ap);
 
@@ -240,7 +243,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));
+                ErrorMessage("ControlConn: Error in writing response, closing the connection: %s, buf: %s\n", get_error(errno), buf);
                 return false;
             }
         }