aboutsummaryrefslogtreecommitdiff
path: root/Remote/External
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-08-13 17:26:09 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-08-13 17:27:50 -0400
commitc4e65d4c3e8a226fb3ec933bdea3daea903b3e84 (patch)
tree3fa47712d7cd352bd5221a5c1d774632c30c135f /Remote/External
parent411cf4993f47562524b476ab7f2b9721775eabdf (diff)
Added WHEREIS to external special remote protocol.
Diffstat (limited to 'Remote/External')
-rw-r--r--Remote/External/Types.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs
index 3c9e89d40..4bb9f6717 100644
--- a/Remote/External/Types.hs
+++ b/Remote/External/Types.hs
@@ -97,6 +97,7 @@ data Request
| TRANSFER Direction Key FilePath
| CHECKPRESENT Key
| REMOVE Key
+ | WHEREIS Key
deriving (Show)
-- Does PREPARE need to have been sent before this request?
@@ -120,6 +121,7 @@ instance Proto.Sendable Request where
]
formatMessage (CHECKPRESENT key) = [ "CHECKPRESENT", Proto.serialize key ]
formatMessage (REMOVE key) = [ "REMOVE", Proto.serialize key ]
+ formatMessage (WHEREIS key) = [ "WHEREIS", Proto.serialize key ]
-- Responses the external remote can make to requests.
data Response
@@ -141,6 +143,8 @@ data Response
| CHECKURL_CONTENTS Size FilePath
| CHECKURL_MULTI [(URLString, Size, FilePath)]
| CHECKURL_FAILURE ErrorMsg
+ | WHEREIS_SUCCESS String
+ | WHEREIS_FAILURE
| UNSUPPORTED_REQUEST
deriving (Show)
@@ -163,6 +167,8 @@ instance Proto.Receivable Response where
parseCommand "CHECKURL-CONTENTS" = Proto.parse2 CHECKURL_CONTENTS
parseCommand "CHECKURL-MULTI" = Proto.parse1 CHECKURL_MULTI
parseCommand "CHECKURL-FAILURE" = Proto.parse1 CHECKURL_FAILURE
+ parseCommand "WHEREIS-SUCCESS" = Just . WHEREIS_SUCCESS
+ parseCommand "WHEREIS-FAILURE" = Proto.parse0 WHEREIS_FAILURE
parseCommand "UNSUPPORTED-REQUEST" = Proto.parse0 UNSUPPORTED_REQUEST
parseCommand _ = Proto.parseFail