mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
ensure 64 bit alignment for 64 bit struct fields access atomically
This commit is contained in:
@@ -20,6 +20,9 @@ import (
|
||||
|
||||
// BaseConnection defines common fields for a connection using any supported protocol
|
||||
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
|
||||
// Unique identifier for the connection
|
||||
ID string
|
||||
// user associated with this connection if any
|
||||
@@ -29,8 +32,6 @@ type BaseConnection struct {
|
||||
protocol string
|
||||
Fs vfs.Fs
|
||||
sync.RWMutex
|
||||
// last activity for this connection
|
||||
lastActivity int64
|
||||
transferID uint64
|
||||
activeTransfers []ActiveTransfer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user