Don't warn about legit requests for deleted files (fixes #173)

This commit is contained in:
Jakob Borg 2014-05-11 14:54:26 -03:00
parent a91eb701bf
commit 94761d0472

View File

@ -323,13 +323,15 @@ func (m *Model) Request(nodeID, repo, name string, offset int64, size int) ([]by
} }
lf := r.Get(cid.LocalID, name) lf := r.Get(cid.LocalID, name)
if offset > lf.Size { if lf.Suppressed || lf.Flags&protocol.FlagDeleted != 0 {
warnf("SECURITY (nonexistent file) REQ(in): %s: %q o=%d s=%d", nodeID, name, offset, size) return nil, ErrInvalid
return nil, ErrNoSuchFile
} }
if lf.Suppressed { if offset > lf.Size {
return nil, ErrInvalid if debugNet {
dlog.Printf("REQ(in; nonexistent): %s: %q o=%d s=%d", nodeID, name, offset, size)
}
return nil, ErrNoSuchFile
} }
if debugNet && nodeID != "<local>" { if debugNet && nodeID != "<local>" {