From ee05e12480a44bd8c8cf98f7736509fb95cd1641 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 19 Aug 2014 15:36:57 +0200 Subject: [PATCH] Windows nodes should ignore deleted impossible files --- protocol/nativemodel_windows.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/protocol/nativemodel_windows.go b/protocol/nativemodel_windows.go index f130df1b..9841d63f 100644 --- a/protocol/nativemodel_windows.go +++ b/protocol/nativemodel_windows.go @@ -29,6 +29,11 @@ type nativeModel struct { func (m nativeModel) Index(nodeID NodeID, repo string, files []FileInfo) { for i, f := range files { if strings.ContainsAny(f.Name, disallowedCharacters) { + if f.IsDeleted() { + // Don't complain if the file is marked as deleted, since it + // can't possibly exist here anyway. + continue + } files[i].Flags |= FlagInvalid l.Warnf("File name %q contains invalid characters; marked as invalid.", f.Name) } @@ -40,6 +45,11 @@ func (m nativeModel) Index(nodeID NodeID, repo string, files []FileInfo) { func (m nativeModel) IndexUpdate(nodeID NodeID, repo string, files []FileInfo) { for i, f := range files { if strings.ContainsAny(f.Name, disallowedCharacters) { + if f.IsDeleted() { + // Don't complain if the file is marked as deleted, since it + // can't possibly exist here anyway. + continue + } files[i].Flags |= FlagInvalid l.Warnf("File name %q contains invalid characters; marked as invalid.", f.Name) }