diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-19 16:08:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-19 16:08:37 -0400 |
commit | aff09a1f33be7b3df182a7c85b30a2d3e04833c7 (patch) | |
tree | 6d7cb4ed4e9483c14bdd832c9af848dc1b866789 /Remote/Helper | |
parent | 3c81d70c1beccb50571281ef35c9123bac006b7c (diff) |
add a progress callback to storeKey, and threaded it all the way through
Transfer info files are updated when the callback is called, updating
the number of bytes transferred.
Left unused p variables at every place the callback should be used.
Which is rather a lot..
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Encryptable.hs | 8 | ||||
-rw-r--r-- | Remote/Helper/Hooks.hs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index 6d5405d9e..e3cb40df4 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -45,7 +45,7 @@ encryptionSetup c = case (M.lookup "encryption" c, extractCipher c) of - to support storing and retrieving encrypted content. -} encryptableRemote :: Maybe RemoteConfig - -> ((Cipher, Key) -> Key -> Annex Bool) + -> ((Cipher, Key) -> Key -> ProgressCallback -> Annex Bool) -> ((Cipher, Key) -> Key -> FilePath -> Annex Bool) -> Remote -> Remote @@ -59,9 +59,9 @@ encryptableRemote c storeKeyEncrypted retrieveKeyFileEncrypted r = cost = cost r + encryptedRemoteCostAdj } where - store k f = cip k >>= maybe - (storeKey r k f) - (`storeKeyEncrypted` k) + store k f p = cip k >>= maybe + (storeKey r k f p) + (\enck -> storeKeyEncrypted enck k p) retrieve k f d = cip k >>= maybe (retrieveKeyFile r k f d) (\enck -> retrieveKeyFileEncrypted enck k d) diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs index 0a6b22081..eb788bc3e 100644 --- a/Remote/Helper/Hooks.hs +++ b/Remote/Helper/Hooks.hs @@ -27,7 +27,7 @@ addHooks' r Nothing Nothing = r addHooks' r starthook stophook = r' where r' = r - { storeKey = \k f -> wrapper $ storeKey r k f + { storeKey = \k f p -> wrapper $ storeKey r k f p , retrieveKeyFile = \k f d -> wrapper $ retrieveKeyFile r k f d , retrieveKeyFileCheap = \k f -> wrapper $ retrieveKeyFileCheap r k f , removeKey = \k -> wrapper $ removeKey r k |