]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction_handlers.go
Fix handshake test
[rbdr/mobius] / hotline / transaction_handlers.go
index 4a8683101d1ca45e490c61d342838d0b59336a08..9e524e823e2d9d4e98e186a96f0d61b4e5ba9af0 100644 (file)
@@ -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))