From 1b2df8a630bfc83304ef90610bdf7ebe91d4e555 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:36:06 -0800 Subject: Fix error when downloading incomplete files --- internal/mobius/transaction_handlers.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'internal') diff --git a/internal/mobius/transaction_handlers.go b/internal/mobius/transaction_handlers.go index 52ea29a..20a315d 100644 --- a/internal/mobius/transaction_handlers.go +++ b/internal/mobius/transaction_handlers.go @@ -86,11 +86,10 @@ const ( // General error messages ErrMsgAccountNotFound = "Account not found." - ErrMsgUserNotFound = "User not found." - ErrMsgCreateAlias = "Error creating alias" + ErrMsgUserNotFound = "User not found." + ErrMsgCreateAlias = "Error creating alias" ) - // Converts bytes from Mac Roman encoding to UTF-8 var txtDecoder = charmap.Macintosh.NewDecoder() @@ -307,7 +306,7 @@ func HandleGetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []ho return res } - fw, err := hotline.NewFileWrapper(cc.Server.FS, fullFilePath, 0) + fw, err := hotline.NewFile(cc.Server.FS, fullFilePath, 0) if err != nil { return res } @@ -361,7 +360,7 @@ func HandleSetFileInfo(cc *hotline.ClientConn, t *hotline.Transaction) (res []ho return res } - hlFile, err := hotline.NewFileWrapper(cc.Server.FS, fullFilePath, 0) + hlFile, err := hotline.NewFile(cc.Server.FS, fullFilePath, 0) if err != nil { return res } @@ -449,7 +448,7 @@ func HandleDeleteFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hot return res } - hlFile, err := hotline.NewFileWrapper(cc.Server.FS, fullFilePath, 0) + hlFile, err := hotline.NewFile(cc.Server.FS, fullFilePath, 0) if err != nil { return res } @@ -494,7 +493,7 @@ func HandleMoveFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotli cc.Logger.Info("Move file", "src", filePath+"/"+fileName, "dst", fileNewPath+"/"+fileName) - hlFile, err := hotline.NewFileWrapper(cc.Server.FS, filePath, 0) + hlFile, err := hotline.NewFile(cc.Server.FS, filePath, 0) if err != nil { return res } @@ -1553,7 +1552,7 @@ func HandleDownloadFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []h return res } - hlFile, err := hotline.NewFileWrapper(cc.Server.FS, fullFilePath, dataOffset) + hlFile, err := hotline.NewFile(cc.Server.FS, fullFilePath, dataOffset) if err != nil { return res } -- cgit