From 229af4c25a78e1f93d4d16410dff649d1942f7cf Mon Sep 17 00:00:00 2001 From: "Vitalii Izhyk -X (viizhyk - SOFTSERVE INC at Cisco)" Date: Fri, 13 Dec 2024 15:42:42 +0000 Subject: [PATCH] Pull request #4544: appid: Extended error log in controlcon. Merge in SNORT/snort3 from ~VIIZHYK/snort3:controlcon_log to master Squashed commit of the following: commit 8fde0b7a2381b41adc6b07b9b8378be7b342d227 Author: viizhyk Date: Fri Dec 13 04:39:48 2024 -0500 appid: Enhanced control error message with additional info. --- src/control/control.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/control/control.cc b/src/control/control.cc index 6d42e7632..80ef8dca5 100644 --- a/src/control/control.cc +++ b/src/control/control.cc @@ -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; } } -- 2.47.3