From c122133021773310cfdd24d36d91432de9cd0b3b Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Mon, 18 Sep 2023 21:11:51 +0200 Subject: [PATCH] better debug message --- modbussrv.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modbussrv.cc b/modbussrv.cc index 20d62a5..b2e5542 100644 --- a/modbussrv.cc +++ b/modbussrv.cc @@ -259,10 +259,11 @@ void ModbusSrv::ServerThread() { } else { char *txt = (char*)malloc(255); - snprintf (txt, 255, "error on processing message\n"); + snprintf (txt, 255, "error on processing message, close connection\n"); gdk_threads_add_idle(cb_thread_network_text_add, txt); delete clients[slot]; clients[slot] = NULL; + } } else if (mbindata->fc == 5 || mbindata->fc == 6) { @@ -273,7 +274,7 @@ void ModbusSrv::ServerThread() { } else { char *txt = (char*)malloc(255); - snprintf (txt, 255, "error on processing message\n"); + snprintf (txt, 255, "error on processing message, close connection\n"); gdk_threads_add_idle(cb_thread_network_text_add, txt); delete clients[slot]; clients[slot] = NULL; @@ -285,7 +286,7 @@ void ModbusSrv::ServerThread() { } else { char *txt = (char*)malloc(255); - snprintf (txt, 255, "error on processing message\n"); + snprintf (txt, 255, "error on processing message, close connection\n"); gdk_threads_add_idle(cb_thread_network_text_add, txt); delete clients[slot]; clients[slot] = NULL;