diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-05-11 17:33:18 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-05-11 17:36:03 -0400 |
commit | a087841ae775a14197c1550488f54b5761f4700b (patch) | |
tree | 93b0c8f09107395bd58f9dc7210b8ee0817cf20d /Annex.hs | |
parent | b09ac870e1dd2bc924c2ab4cd1d2280024a8a80a (diff) |
Ssh password prompting improved when using -J
When ssh connection caching is enabled (and when GIT_ANNEX_USE_GIT_SSH is
not set), only one ssh password prompt will be made per host, and only one
ssh password prompt will be made at a time.
This also fixes a race in prepSocket's stale ssh connection stopping
when run with -J. It was possible for one thread to start a cached ssh
connection, and another thread to immediately stop it, resulting in excess
connections being made.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -124,6 +124,7 @@ data AnnexState = AnnexState , groupmap :: Maybe GroupMap , ciphers :: M.Map StorableCipher Cipher , lockcache :: LockCache + , sshstalecleaned :: MVar () , flags :: M.Map String Bool , fields :: M.Map String String , cleanup :: M.Map CleanupAction (Annex ()) @@ -145,6 +146,8 @@ data AnnexState = AnnexState newState :: GitConfig -> Git.Repo -> IO AnnexState newState c r = do emptyactiveremotes <- newMVar M.empty + o <- newMessageState + sc <- newMVar () return $ AnnexState { repo = r , repoadjustment = return @@ -152,7 +155,7 @@ newState c r = do , backend = Nothing , remotes = [] , remoteannexstate = M.empty - , output = def + , output = o , concurrency = NonConcurrent , force = False , fast = False @@ -175,6 +178,7 @@ newState c r = do , groupmap = Nothing , ciphers = M.empty , lockcache = M.empty + , sshstalecleaned = sc , flags = M.empty , fields = M.empty , cleanup = M.empty |