aboutsummaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
Diffstat (limited to 'Remote')
-rw-r--r--Remote/External.hs6
-rw-r--r--Remote/External/Types.hs6
2 files changed, 12 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"
diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs
index 3a69ae9ea..cdcb657ea 100644
--- a/Remote/External/Types.hs
+++ b/Remote/External/Types.hs
@@ -165,6 +165,9 @@ data RemoteRequest
| GETWANTED
| SETSTATE Key String
| GETSTATE Key
+ | SETURLPRESENT Key String
+ | SETURLMISSING Key String
+ | GETURLS Key String
| DEBUG String
deriving (Show)
@@ -182,6 +185,9 @@ instance Proto.Receivable RemoteRequest where
parseCommand "GETWANTED" = Proto.parse0 GETWANTED
parseCommand "SETSTATE" = Proto.parse2 SETSTATE
parseCommand "GETSTATE" = Proto.parse1 GETSTATE
+ parseCommand "SETURLPRESENT" = Proto.parse2 SETURLPRESENT
+ parseCommand "SETURLMISSING" = Proto.parse2 SETURLMISSING
+ parseCommand "GETURLS" = Proto.parse2 GETURLS
parseCommand "DEBUG" = Proto.parse1 DEBUG
parseCommand _ = Proto.parseFail