From 0da55f95ab9605f6053c7c67949419d99d377aa0 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Thu, 1 Oct 2020 10:35:59 -0400 Subject: [PATCH] Fixed a 64-bit integer alighment problem on 32-bit OS A new variable was added previosuly which caused a 64-bit variable to be not aligned on a 8-byte boundary. Go still can't handle such variables on 32-bit OS. --- src/duplicacy_chunkdownloader.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/duplicacy_chunkdownloader.go b/src/duplicacy_chunkdownloader.go index e0fb883..f48cd0f 100644 --- a/src/duplicacy_chunkdownloader.go +++ b/src/duplicacy_chunkdownloader.go @@ -31,6 +31,9 @@ type ChunkDownloadCompletion struct { // corresponding ChunkDownloadTask is sent to the dowloading goroutine. Once a chunk is downloaded, it will be // inserted in the completed task list. type ChunkDownloader struct { + totalChunkSize int64 // Total chunk size + downloadedChunkSize int64 // Downloaded chunk size + config *Config // Associated config storage Storage // Download from this storage snapshotCache *FileStorage // Used as cache if not nil; usually for downloading snapshot chunks @@ -47,8 +50,6 @@ type ChunkDownloader struct { completionChannel chan ChunkDownloadCompletion // A downloading goroutine sends back the chunk via this channel after downloading startTime int64 // The time it starts downloading - totalChunkSize int64 // Total chunk size - downloadedChunkSize int64 // Downloaded chunk size numberOfDownloadedChunks int // The number of chunks that have been downloaded numberOfDownloadingChunks int // The number of chunks still being downloaded numberOfActiveChunks int // The number of chunks that is being downloaded or has been downloaded but not reclaimed