mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
parent
abb3fb8a31
commit
c40c9a8d6a
@ -535,7 +535,12 @@ func (w *walker) updateFileInfo(file, curFile protocol.FileInfo) protocol.FileIn
|
|||||||
file.LocalFlags = w.LocalFlags
|
file.LocalFlags = w.LocalFlags
|
||||||
return file
|
return file
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *walker) handleError(ctx context.Context, context, path string, err error, finishedChan chan<- ScanResult) {
|
func (w *walker) handleError(ctx context.Context, context, path string, err error, finishedChan chan<- ScanResult) {
|
||||||
|
// Ignore missing items, as deletions are not handled by the scanner.
|
||||||
|
if fs.IsNotExist(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
l.Infof("Scanner (folder %s, file %q): %s: %v", w.Folder, path, context, err)
|
l.Infof("Scanner (folder %s, file %q): %s: %v", w.Folder, path, context, err)
|
||||||
select {
|
select {
|
||||||
case finishedChan <- ScanResult{
|
case finishedChan <- ScanResult{
|
||||||
|
@ -738,6 +738,23 @@ func TestIssue4841(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestNotExistingError reproduces https://github.com/syncthing/syncthing/issues/5385
|
||||||
|
func TestNotExistingError(t *testing.T) {
|
||||||
|
sub := "notExisting"
|
||||||
|
if _, err := testFs.Lstat(sub); !fs.IsNotExist(err) {
|
||||||
|
t.Fatalf("Lstat returned error %v, while nothing should exist there.", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fchan := Walk(context.TODO(), Config{
|
||||||
|
Filesystem: testFs,
|
||||||
|
Subs: []string{sub},
|
||||||
|
Hashers: 2,
|
||||||
|
})
|
||||||
|
for f := range fchan {
|
||||||
|
t.Fatalf("Expected no result from scan, got %v", f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Verify returns nil or an error describing the mismatch between the block
|
// Verify returns nil or an error describing the mismatch between the block
|
||||||
// list and actual reader contents
|
// list and actual reader contents
|
||||||
func verify(r io.Reader, blocksize int, blocks []protocol.BlockInfo) error {
|
func verify(r io.Reader, blocksize int, blocks []protocol.BlockInfo) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user