diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-01 16:59:54 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-01 17:15:11 -0400 |
commit | 7225c2bfc0c7149e646fa9af998da983e3fa8bc8 (patch) | |
tree | a07f878efd0876f539e4c10a6572be001ef41189 /Remote/Web.hs | |
parent | 8c10f377146e6599054488f47a3a742f6a7c5ae2 (diff) |
record transfer information on local git remotes
In order to record a semi-useful filename associated with the key,
this required plumbing the filename all the way through to the remotes'
storeKey and retrieveKeyFile.
Note that there is potential for deadlock here, narrowly avoided.
Suppose the repos are A and B. A sends file foo to B, and at the same
time, B gets file foo from A. So, A locks its upload transfer info file,
and then locks B's download transfer info file. At the same time,
B is taking the two locks in the opposite order. This is only not a
deadlock because the lock code does not wait, and aborts. So one of A or
B's transfers will be aborted and the other transfer will continue.
Whew!
Diffstat (limited to 'Remote/Web.hs')
-rw-r--r-- | Remote/Web.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Remote/Web.hs b/Remote/Web.hs index 5fc592326..2516240ab 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -51,21 +51,21 @@ gen r _ _ = remotetype = remote } -downloadKey :: Key -> FilePath -> Annex Bool -downloadKey key file = get =<< getUrls key +downloadKey :: Key -> AssociatedFile -> FilePath -> Annex Bool +downloadKey key _file dest = get =<< getUrls key where get [] = do warning "no known url" return False get urls = do showOutput -- make way for download progress bar - downloadUrl urls file + downloadUrl urls dest downloadKeyCheap :: Key -> FilePath -> Annex Bool downloadKeyCheap _ _ = return False -uploadKey :: Key -> Annex Bool -uploadKey _ = do +uploadKey :: Key -> AssociatedFile -> Annex Bool +uploadKey _ _ = do warning "upload to web not supported" return False |