lib/protocol: Correct block size calculation on 32 bit archs (fixes #4990) (#4991)

This commit is contained in:
Jakob Borg 2018-06-06 09:59:33 +02:00 committed by GitHub
parent 27d675a793
commit 76f9e5c5db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -54,7 +54,7 @@ func init() {
func BlockSize(fileSize int64) int { func BlockSize(fileSize int64) int {
var blockSize int var blockSize int
for _, blockSize = range BlockSizes { for _, blockSize = range BlockSizes {
if fileSize < int64(DesiredPerFileBlocks*blockSize) { if fileSize < DesiredPerFileBlocks*int64(blockSize) {
break break
} }
} }

View File

@ -4,6 +4,7 @@ package protocol
import ( import (
"bytes" "bytes"
"encoding/hex"
"encoding/json" "encoding/json"
"errors" "errors"
"io" "io"
@ -12,8 +13,6 @@ import (
"testing" "testing"
"testing/quick" "testing/quick"
"encoding/hex"
"github.com/syncthing/syncthing/lib/rand" "github.com/syncthing/syncthing/lib/rand"
) )