fix transfers of key with no associated file
Several places assumed this would not happen, and when the AssociatedFile was Nothing, did nothing. As part of this, preferred content checks pass the Key around. Note that checkMatcher is sometimes now called with Just Key and Just File. It currently constructs a FileMatcher, ignoring the Key. However, if it constructed a FileKeyMatcher, which contained both, then it might be possible to speed up parts of Limit, which currently call the somewhat expensive lookupFileKey to get the Key. I have not made this optimisation yet, because I am not sure if the key is always the same. Will need some significant checking to satisfy myself that's the case..
This commit is contained in:
parent
90bc6e3137
commit
3518c586cf
13 changed files with 79 additions and 64 deletions
|
@ -164,9 +164,9 @@ expensiveScan urlrenderer rs = unless onlyweb $ batch <~> do
|
|||
let slocs = S.fromList locs
|
||||
let use a = return $ mapMaybe (a key slocs) syncrs
|
||||
ts <- if present
|
||||
then filterM (wantSend True (Just f) . Remote.uuid . fst)
|
||||
then filterM (wantSend True (Just key) (Just f) . Remote.uuid . fst)
|
||||
=<< use (genTransfer Upload False)
|
||||
else ifM (wantGet True $ Just f)
|
||||
else ifM (wantGet True (Just key) (Just f))
|
||||
( use (genTransfer Download True) , return [] )
|
||||
let unwanted' = S.difference unwanted slocs
|
||||
return (unwanted', ts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue