summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-11 15:43:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-11 16:03:45 -0400
commit5387b44657d01e436282e3ae6650a8f083b5ef00 (patch)
treec208fb8505e28d1998ea96a1cf63929e9053749d /Remote
parent4979c878da4dcacf699b4d0b2e2f173e0d0bd06e (diff)
safe recv-key in direct mode
Checks the key's size and checksum. This is sorta expensive, but it avoids needing to add another round-trip to the protocol.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index e8e1a1ba2..8c8d1274c 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -398,7 +398,9 @@ rsyncOrCopyFile rsyncparams src dest p =
rsyncParamsRemote :: Remote -> Direction -> Key -> FilePath -> AssociatedFile -> Annex [CommandParam]
rsyncParamsRemote r direction key file afile = do
u <- getUUID
+ direct <- isDirect
let fields = (Fields.remoteUUID, fromUUID u)
+ : (Fields.direct, if direct then "1" else "")
: maybe [] (\f -> [(Fields.associatedFile, f)]) afile
Just (shellcmd, shellparams) <- git_annex_shell (repo r)
(if direction == Download then "sendkey" else "recvkey")