aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2025-12-05 18:42:57 -0800
committerJeff Halter <868228+jhalter@users.noreply.github.com>2025-12-05 18:42:57 -0800
commit472ec3556a66530e7d2255f75ced81cbbf3a1c74 (patch)
treeb9c39907d0a9056cd706a9c6fcde534b6e065ac4 /internal
parente4bdf40802188262c1049edfd41a19bbe76e632e (diff)
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
Diffstat (limited to 'internal')
-rw-r--r--internal/mobius/transaction_handlers.go5
1 files changed, 2 insertions, 3 deletions
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