diff options
author | 2016-12-09 16:02:43 -0400 | |
---|---|---|
committer | 2016-12-09 16:02:43 -0400 | |
commit | 46f3063131f7711208c1134b31caf999e375306d (patch) | |
tree | 47ab66581b0d2de95865b0f7948db041f6589935 /P2P/Protocol.hs | |
parent | 1eeae43d88c924dfac7c004ff7aeb67e17c52a13 (diff) |
remotedaemon: git change detection over tor hidden service
Diffstat (limited to 'P2P/Protocol.hs')
-rw-r--r-- | P2P/Protocol.hs | 10 |
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) |