mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Have only one block size
This commit is contained in:
parent
493dc8fcd5
commit
41b8dd2863
@ -1001,7 +1001,7 @@ func (m *Model) ScanFolderSub(folder, sub string) error {
|
|||||||
Dir: dir,
|
Dir: dir,
|
||||||
Sub: sub,
|
Sub: sub,
|
||||||
Ignores: ignores,
|
Ignores: ignores,
|
||||||
BlockSize: scanner.StandardBlockSize,
|
BlockSize: protocol.BlockSize,
|
||||||
TempNamer: defTempNamer,
|
TempNamer: defTempNamer,
|
||||||
CurrentFiler: cFiler{m, folder},
|
CurrentFiler: cFiler{m, folder},
|
||||||
IgnorePerms: m.folderCfgs[folder].IgnorePerms,
|
IgnorePerms: m.folderCfgs[folder].IgnorePerms,
|
||||||
|
@ -469,7 +469,7 @@ func (p *Puller) shortcutFile(file protocol.FileInfo) {
|
|||||||
// copierRoutine reads pullerStates until the in channel closes and performs
|
// copierRoutine reads pullerStates until the in channel closes and performs
|
||||||
// the relevant copy.
|
// the relevant copy.
|
||||||
func (p *Puller) copierRoutine(in <-chan copyBlocksState, out chan<- *sharedPullerState) {
|
func (p *Puller) copierRoutine(in <-chan copyBlocksState, out chan<- *sharedPullerState) {
|
||||||
buf := make([]byte, scanner.StandardBlockSize)
|
buf := make([]byte, protocol.BlockSize)
|
||||||
|
|
||||||
nextFile:
|
nextFile:
|
||||||
for state := range in {
|
for state := range in {
|
||||||
@ -575,7 +575,7 @@ func (p *Puller) finisherRoutine(in <-chan *sharedPullerState) {
|
|||||||
l.Warnln("puller: final:", err)
|
l.Warnln("puller: final:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = scanner.Verify(fd, scanner.StandardBlockSize, state.file.Blocks)
|
err = scanner.Verify(fd, protocol.BlockSize, state.file.Blocks)
|
||||||
fd.Close()
|
fd.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(state.tempName)
|
os.Remove(state.tempName)
|
||||||
|
@ -24,8 +24,6 @@ import (
|
|||||||
"github.com/syncthing/syncthing/internal/protocol"
|
"github.com/syncthing/syncthing/internal/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
const StandardBlockSize = 128 * 1024
|
|
||||||
|
|
||||||
var sha256OfNothing = []uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}
|
var sha256OfNothing = []uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}
|
||||||
|
|
||||||
// Blocks returns the blockwise hash of the reader.
|
// Blocks returns the blockwise hash of the reader.
|
||||||
|
Loading…
Reference in New Issue
Block a user