From 619919bd49c342de60a63f16c835f0dd4acb9acb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Apr 2014 15:30:39 -0400 Subject: send remote-daemon a RELOAD after making a ssh remote This doesn't work yet, because RELOAD is buggy and does not notice the new remote. --- Assistant/Threads/RemoteControl.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Assistant/Threads/RemoteControl.hs') diff --git a/Assistant/Threads/RemoteControl.hs b/Assistant/Threads/RemoteControl.hs index a886caeb9..317efe412 100644 --- a/Assistant/Threads/RemoteControl.hs +++ b/Assistant/Threads/RemoteControl.hs @@ -52,10 +52,12 @@ remoteControlThread = namedThread "RemoteControl" $ do remoteControllerThread :: Handle -> Assistant () remoteControllerThread toh = do clicker <- getAssistant remoteControl - liftIO $ forever $ do - msg <- readChan clicker - hPutStrLn toh $ unwords $ formatMessage msg - hFlush toh + forever $ do + msg <- liftIO $ readChan clicker + debug [show msg] + liftIO $ do + hPutStrLn toh $ unwords $ formatMessage msg + hFlush toh -- read status messages emitted by the remotedaemon and handle them remoteResponderThread :: Handle -> MVar (M.Map URI Remote) -> Assistant () @@ -63,6 +65,7 @@ remoteResponderThread fromh urimap = go M.empty where go syncalerts = do l <- liftIO $ hGetLine fromh + debug [l] case parseMessage l of Just (CONNECTED uri) -> changeconnected S.insert uri Just (DISCONNECTED uri) -> changeconnected S.delete uri -- cgit v1.2.3