avoid setPresent when sending to a peer
This mirrors how git-annex-shell works; recvKey updates location tracking, but sendKey does not.
This commit is contained in:
parent
65e903397c
commit
ae403be24b
1 changed files with 3 additions and 4 deletions
|
@ -160,10 +160,6 @@ serve myuuid = go Nothing
|
||||||
go autheduuid
|
go autheduuid
|
||||||
|
|
||||||
authed theiruuid r = case r of
|
authed theiruuid r = case r of
|
||||||
GET offset key -> do
|
|
||||||
ok <- sendContent key offset
|
|
||||||
when ok $
|
|
||||||
setPresent key theiruuid
|
|
||||||
PUT key -> do
|
PUT key -> do
|
||||||
(Len n) <- keyFileSize key
|
(Len n) <- keyFileSize key
|
||||||
let offset = Offset n
|
let offset = Offset n
|
||||||
|
@ -174,6 +170,9 @@ serve myuuid = go Nothing
|
||||||
void $ receiveContent key offset len
|
void $ receiveContent key offset len
|
||||||
setPresent key myuuid
|
setPresent key myuuid
|
||||||
_ -> sendMessage (PROTO_ERROR "expected DATA")
|
_ -> sendMessage (PROTO_ERROR "expected DATA")
|
||||||
|
-- setPresent not called because the peer may have
|
||||||
|
-- requested the data but not permanatly stored it.
|
||||||
|
GET offset key -> sendContent key offset
|
||||||
_ -> sendMessage (PROTO_ERROR "unexpected command")
|
_ -> sendMessage (PROTO_ERROR "unexpected command")
|
||||||
|
|
||||||
sendContent :: Key -> Offset -> Proto Bool
|
sendContent :: Key -> Offset -> Proto Bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue