added retrieveKeyFileInOrder and ORDERED to external special remote protocol
I anticipate lots of external special remote programs will neglect implementing this. Still, it's the right thing to do to assume that some of them may write files out of order. Probably most external special remotes will not be used with a proxy. When someone is using one with a proxy, they can always get it fixed to send ORDERED.
This commit is contained in:
parent
f920d90781
commit
d9b4bf4224
28 changed files with 80 additions and 13 deletions
|
@ -248,12 +248,13 @@ proxySpecialRemote protoversion r ihdl ohdl owaitv oclosedv mexportdb = go
|
|||
writeVerifyChunk iv h b
|
||||
storetofile iv h (n - fromIntegral (B.length b)) bs
|
||||
|
||||
proxyget offset af k = withproxytmpfile k $ \tmpfile ->
|
||||
proxyget offset af k = withproxytmpfile k $ \tmpfile -> do
|
||||
let retrieve = tryNonAsync $ Remote.retrieveKeyFile r k af
|
||||
(fromRawFilePath tmpfile) nullMeterUpdate vc
|
||||
in case fromKey keySize k of
|
||||
ordered <- Remote.retrieveKeyFileInOrder r
|
||||
case fromKey keySize k of
|
||||
#ifndef mingw32_HOST_OS
|
||||
Just size | size > 0 -> do
|
||||
Just size | size > 0 && ordered -> do
|
||||
cancelv <- liftIO newEmptyMVar
|
||||
donev <- liftIO newEmptyMVar
|
||||
streamer <- liftIO $ async $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue