aboutsummaryrefslogtreecommitdiff
path: root/hotline/transaction_handlers.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 15:27:54 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 15:27:54 -0700
commit0a92e50b2704c1eb02233c9aa5778d21455d345b (patch)
tree27739e4471b5771a90cc58ac568fe268578f5c28 /hotline/transaction_handlers.go
parentd1cd666473e5d9097b34bad3388c8c0595612089 (diff)
Fix some data races
Diffstat (limited to 'hotline/transaction_handlers.go')
-rw-r--r--hotline/transaction_handlers.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go
index 4a86831..abe2c54 100644
--- a/hotline/transaction_handlers.go
+++ b/hotline/transaction_handlers.go
@@ -1521,12 +1521,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))