From 472ec3556a66530e7d2255f75ced81cbbf3a1c74 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Fri, 5 Dec 2025 18:42:57 -0800 Subject: Improve error handling, logging, and fix race condition in Disconnect - Add logging for unhandled transaction types in Client.HandleTransaction - Fix race condition in Client.Disconnect by protecting done channel with mutex - Add TranServerMsg to transaction type names map - Use Time type instead of raw byte array in File.flattenedFileObject - Improve error message in handleFileTransfer to include reference number - Simplify return statement in HandleGetFileInfo --- internal/mobius/transaction_handlers.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'internal') diff --git a/internal/mobius/transaction_handlers.go b/internal/mobius/transaction_handlers.go index 20a315d..c2578bb 100644 --- a/internal/mobius/transaction_handlers.go +++ b/internal/mobius/transaction_handlers.go @@ -324,7 +324,7 @@ func HandleGetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []ho hotline.NewField(hotline.FieldFileCreateDate, fw.Ffo.FlatFileInformationFork.CreateDate[:]), hotline.NewField(hotline.FieldFileModifyDate, fw.Ffo.FlatFileInformationFork.ModifyDate[:]), } - + // Include the optional FileComment field if there is a comment. if len(fw.Ffo.FlatFileInformationFork.Comment) != 0 { fields = append(fields, hotline.NewField(hotline.FieldFileComment, fw.Ffo.FlatFileInformationFork.Comment)) @@ -335,8 +335,7 @@ func HandleGetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []ho fields = append(fields, hotline.NewField(hotline.FieldFileSize, fw.TotalSize())) } - res = append(res, cc.NewReply(t, fields...)) - return res + return append(res, cc.NewReply(t, fields...)) } // HandleSetFileInfo updates a file or folder Name and/or comment from the Get Info window -- cgit