diff options
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/External.hs | 5 | ||||
-rw-r--r-- | Remote/External/Types.hs | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Remote/External.hs b/Remote/External.hs index ae026ca1f..1cf199e99 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -152,7 +152,8 @@ safely a = go =<< tryAnnex a return False {- Sends a Request to the external remote, and waits for it to generate - - a Response that the responsehandler accepts. + - a Response. That is fed into the responsehandler, which should return + - the action to run for it (or Nothing if there's a protocol error). - - While the external remote is processing the Request, it may send - any number of RemoteRequests, that are handled here. @@ -291,7 +292,7 @@ getCost external r gc = go =<< remoteCost' gc go Nothing = do c <- handleRequest external GETCOST Nothing $ \req -> case req of COST c -> Just $ return c - COST_UNKNOWN -> Just $ return expensiveRemoteCost + UNSUPPORTED_REQUEST -> Just $ return expensiveRemoteCost _ -> Nothing setRemoteCost r c return c diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs index ed8534a07..873c5c438 100644 --- a/Remote/External/Types.hs +++ b/Remote/External/Types.hs @@ -118,10 +118,9 @@ data Response | REMOVE_SUCCESS Key | REMOVE_FAILURE Key ErrorMsg | COST Cost - | COST_UNKNOWN | INITREMOTE_SUCCESS | INITREMOTE_FAILURE ErrorMsg - | UNKNOWN_REQUEST + | UNSUPPORTED_REQUEST deriving (Show) instance Receivable Response where @@ -134,10 +133,9 @@ instance Receivable Response where parseCommand "REMOVE-SUCCESS" = parse1 REMOVE_SUCCESS parseCommand "REMOVE-FAILURE" = parse2 REMOVE_FAILURE parseCommand "COST" = parse1 COST - parseCommand "COST_UNKNOWN" = parse0 COST_UNKNOWN parseCommand "INITREMOTE-SUCCESS" = parse0 INITREMOTE_SUCCESS parseCommand "INITREMOTE-FAILURE" = parse1 INITREMOTE_FAILURE - parseCommand "UNKNOWN-REQUEST" = parse0 UNKNOWN_REQUEST + parseCommand "UNSUPPORTED-REQUEST" = parse0 UNSUPPORTED_REQUEST parseCommand _ = parseFail -- Requests that the external remote can send at any time it's in control. |