remotedaemon: git change detection over tor hidden service

This commit is contained in:
Joey Hess 2016-12-09 16:02:43 -04:00
parent f7687e0876
commit 2c907fff51
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
8 changed files with 116 additions and 46 deletions

View file

@ -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)