X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/d1cd666473e5d9097b34bad3388c8c0595612089..b365559d0b92cbd2193d72365d32baa62c62a98e:/hotline/transaction_handlers.go diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 4a86831..9e524e8 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -419,7 +419,7 @@ func HandleGetFileInfo(cc *ClientConn, t *Transaction) (res []Transaction, err e res = append(res, cc.NewReply(t, NewField(fieldFileName, fileName), - NewField(fieldFileTypeString, ffo.FlatFileInformationFork.TypeSignature), + NewField(fieldFileTypeString, ffo.FlatFileInformationFork.friendlyType()), NewField(fieldFileCreatorString, ffo.FlatFileInformationFork.CreatorSignature), NewField(fieldFileComment, ffo.FlatFileInformationFork.Comment), NewField(fieldFileType, ffo.FlatFileInformationFork.TypeSignature), @@ -1411,7 +1411,9 @@ func HandleDownloadFolder(cc *ClientConn, t *Transaction) (res []Transaction, er ReferenceNumber: transactionRef, Type: FolderDownload, } + cc.Server.mux.Lock() cc.Server.FileTransfers[data] = fileTransfer + cc.Server.mux.Unlock() cc.Transfers[FolderDownload] = append(cc.Transfers[FolderDownload], fileTransfer) var fp FilePath @@ -1521,12 +1523,14 @@ func HandleUploadFile(cc *ClientConn, t *Transaction) (res []Transaction, err er transactionRef := cc.Server.NewTransactionRef() data := binary.BigEndian.Uint32(transactionRef) + cc.Server.mux.Lock() cc.Server.FileTransfers[data] = &FileTransfer{ FileName: fileName, FilePath: filePath, ReferenceNumber: transactionRef, Type: FileUpload, } + cc.Server.mux.Unlock() replyT := cc.NewReply(t, NewField(fieldRefNum, transactionRef))