summaryrefslogtreecommitdiff
path: root/Remote/External.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-08 13:32:27 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-08 13:32:46 -0400
commit1285c91f8f9b3505b4c4137ee5d84c450468333b (patch)
tree087ed20920196ac85d5dca3127a63609eed4d254 /Remote/External.hs
parent941844b60ffae1aeaf96f71eb1ac7d5c932b6621 (diff)
External special remote protocol now includes commands for setting and getting the urls associated with a key.
Diffstat (limited to 'Remote/External.hs')
-rw-r--r--Remote/External.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Remote/External.hs b/Remote/External.hs
index e907ab0cf..dca273d23 100644
--- a/Remote/External.hs
+++ b/Remote/External.hs
@@ -19,6 +19,7 @@ import Utility.Metered
import Logs.Transfer
import Logs.PreferredContent.Raw
import Logs.RemoteState
+import Logs.Web
import Config.Cost
import Annex.UUID
import Creds
@@ -215,6 +216,11 @@ handleRequest' lck external req mp responsehandler
state <- fromMaybe ""
<$> getRemoteState (externalUUID external) key
send $ VALUE state
+ handleRemoteRequest (SETURLPRESENT key url) = setUrlPresent key url
+ handleRemoteRequest (SETURLMISSING key url) = setUrlMissing key url
+ handleRemoteRequest (GETURLS key prefix) = do
+ mapM_ (send . VALUE) =<< getUrlsWithPrefix key prefix
+ send (VALUE "") -- end of list
handleRemoteRequest (DEBUG msg) = liftIO $ debugM "external" msg
handleRemoteRequest (VERSION _) =
sendMessage lck external $ ERROR "too late to send VERSION"