summaryrefslogtreecommitdiff
path: root/Remote/External.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-27 02:08:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-27 02:11:06 -0400
commit245b3eb1a5f2a9b786c297be3d45aecab29d6110 (patch)
tree25c913aab4f0d7626faff00020b04ff9c45eda91 /Remote/External.hs
parent4708090fcb854d3e4cd3199d260b03df8a521c07 (diff)
make some requests optional, simplify and future-proof protocol more
Diffstat (limited to 'Remote/External.hs')
-rw-r--r--Remote/External.hs5
1 files changed, 3 insertions, 2 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