From c4f043a2369efe905b084af09b4388d56ea71a1f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:23:34 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Isolate=20packet=20handler=20exc?= =?UTF-8?q?eptions=20on=20the=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A handler exception left the packet in the queue, re-raising on every receive until the app aborted. The connection is now dropped cleanly with a log entry. --- Client/UdmNetwork.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Client/UdmNetwork.pas b/Client/UdmNetwork.pas index ff86089..58c5c58 100644 --- a/Client/UdmNetwork.pas +++ b/Client/UdmNetwork.pas @@ -79,7 +79,7 @@ uses UfrmBoundaries, UfrmElevateSettings, UfrmConfirmation, UfrmMoveSettings, UfrmAbout, UfrmHueSettings, UfrmRadar, UfrmLargeScaleCommand, UfrmVirtualLayer, UfrmFilter, UfrmRegionControl, UfrmLightlevel, - UfrmChangePassword; + UfrmChangePassword, Logging; {$I version.inc} @@ -279,7 +279,18 @@ begin if FReceiveQueue.Size >= size then begin FReceiveQueue.Lock(FReceiveQueue.Position, size - FReceiveQueue.Position); //prevent handler from reading too much - packetHandler.Process(FReceiveQueue); + try + packetHandler.Process(FReceiveQueue); + except + on E: Exception do + begin + Logger.Send([lcClient, lcError], 'Packet handler exception: %s', [E.Message]); + FReceiveQueue.Unlock; + Disconnect; + FReceiveQueue.Clear; + Exit; + end; + end; FReceiveQueue.Unlock; FReceiveQueue.Dequeue(size); end else