diff options
author | Jakob Borg <jakob@nym.se> | 2014-05-11 14:54:26 -0300 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-05-11 14:54:26 -0300 |
commit | 94761d04724226dd743b445a2f2ddb2b8564668d (patch) | |
tree | 12201bfe3fc85e6a59036c5a1bee620fe01f9443 /cmd | |
parent | a91eb701bf2d225eb85fc1c52ae5e76be06f1a5e (diff) |
Don't warn about legit requests for deleted files (fixes #173)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/syncthing/model.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/syncthing/model.go b/cmd/syncthing/model.go index bda17b36bd..852c428519 100644 --- a/cmd/syncthing/model.go +++ b/cmd/syncthing/model.go @@ -323,13 +323,15 @@ func (m *Model) Request(nodeID, repo, name string, offset int64, size int) ([]by } lf := r.Get(cid.LocalID, name) - if offset > lf.Size { - warnf("SECURITY (nonexistent file) REQ(in): %s: %q o=%d s=%d", nodeID, name, offset, size) - return nil, ErrNoSuchFile + if lf.Suppressed || lf.Flags&protocol.FlagDeleted != 0 { + return nil, ErrInvalid } - if lf.Suppressed { - return nil, ErrInvalid + if offset > lf.Size { + if debugNet { + dlog.Printf("REQ(in; nonexistent): %s: %q o=%d s=%d", nodeID, name, offset, size) + } + return nil, ErrNoSuchFile } if debugNet && nodeID != "<local>" { |