From bd9506da428748a2d9ff4b04a2d2646d0439902c Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 28 Aug 2021 10:06:49 +0200 Subject: [PATCH] BaseConnection struct: ensure 64 bit alignment Fixes #516 --- common/connection.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/connection.go b/common/connection.go index b45ca4ea..21f339a6 100644 --- a/common/connection.go +++ b/common/connection.go @@ -25,6 +25,8 @@ type BaseConnection struct { // last activity for this connection. // Since this is accessed atomically we put as first element of the struct achieve 64 bit alignment lastActivity int64 + // transferID is accessed atomically so we put it at the beginning of the struct to achieve 64 bit alignment + transferID uint64 // Unique identifier for the connection ID string // user associated with this connection if any @@ -35,7 +37,6 @@ type BaseConnection struct { remoteAddr string localAddr string sync.RWMutex - transferID uint64 activeTransfers []ActiveTransfer }