summaryrefslogtreecommitdiff
path: root/P2P/Protocol.hs
diff options
context:
space:
mode:
Diffstat (limited to 'P2P/Protocol.hs')
-rw-r--r--P2P/Protocol.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/P2P/Protocol.hs b/P2P/Protocol.hs
index d8be3ff42..c3c362f37 100644
--- a/P2P/Protocol.hs
+++ b/P2P/Protocol.hs
@@ -441,6 +441,16 @@ sendSuccess :: Bool -> Proto ()
sendSuccess True = net $ sendMessage SUCCESS
sendSuccess False = net $ sendMessage FAILURE
+notifyChange :: Proto (Maybe ChangedRefs)
+notifyChange = do
+ net $ sendMessage NOTIFYCHANGE
+ ack <- net receiveMessage
+ case ack of
+ CHANGED rs -> return (Just rs)
+ _ -> do
+ net $ sendMessage (ERROR "expected CHANGED")
+ return Nothing
+
connect :: Service -> Handle -> Handle -> Proto ExitCode
connect service hin hout = do
net $ sendMessage (CONNECT service)