diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-27 12:37:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-27 12:37:23 -0400 |
commit | bee2200ca2b8d28b9bb7d4f0449627914a6aecbc (patch) | |
tree | 5ed9e93060c9608154ad166164a6396c990af995 /Remote/External | |
parent | 509a2d5f4e53e4c2c79b37cf8caa1982b2fe098c (diff) |
implement GETCONFIG and SETCONFIG
Changed protocol spec to make SETCONFIG only store it persistently when run
during INITREMOTE. I see no reason to support storing it persistently at
other times, and doing so would unnecessarily complicate the code.
Also, letting that be done would probably result in use for storing data that
doesn't really belong there, and special remote authors who don't
understand how the union merging works would probably be surprised the
results.
Diffstat (limited to 'Remote/External')
-rw-r--r-- | Remote/External/Types.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs index 4000f3f49..ff93af0ec 100644 --- a/Remote/External/Types.hs +++ b/Remote/External/Types.hs @@ -30,11 +30,12 @@ module Remote.External.Types ( ) where import Common.Annex -import Types.Key -import Utility.Metered -import Logs.Transfer -import Config.Cost import Annex.Exception +import Types.Key (file2key, key2file) +import Utility.Metered (BytesProcessed(..)) +import Logs.Transfer (Direction(..)) +import Config.Cost (Cost) +import Types.Remote (RemoteConfig) import Data.Char import Control.Concurrent.STM @@ -47,13 +48,16 @@ data External = External , externalState :: TMVar ExternalState -- Empty when a remote is in use. , externalLock :: TMVar ExternalLock + -- Never left empty. + , externalConfig :: TMVar RemoteConfig } -newExternal :: ExternalType -> Annex External -newExternal externaltype = liftIO $ External +newExternal :: ExternalType -> RemoteConfig -> Annex External +newExternal externaltype c = liftIO $ External <$> pure externaltype <*> atomically newEmptyTMVar <*> atomically (newTMVar ExternalLock) + <*> atomically (newTMVar c) type ExternalType = String |