aboutsummaryrefslogtreecommitdiff
path: root/RemoteDaemon/Transport
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-15 15:37:48 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-15 15:37:53 -0400
commitd80aa496961438584c6eb9e5330eb6beba46ec04 (patch)
tree9af03d8c0c7041088626d87da3d42513c5d7ad5d /RemoteDaemon/Transport
parentf4d7cae1f7254b34f1ca7f3fcf3696b0b4948957 (diff)
remotedaemon: Fix problem that could prevent ssh connections being made after two LOSTNET messages were received in a row
Perhaps due to two different network interfaces being brought down. Since there is no reliable way to drain a Chan, I switched to STM TChan.
Diffstat (limited to 'RemoteDaemon/Transport')
-rw-r--r--RemoteDaemon/Transport/Ssh.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/RemoteDaemon/Transport/Ssh.hs b/RemoteDaemon/Transport/Ssh.hs
index afedf559e..6315ede85 100644
--- a/RemoteDaemon/Transport/Ssh.hs
+++ b/RemoteDaemon/Transport/Ssh.hs
@@ -18,7 +18,7 @@ import qualified Git
import Git.Command
import Utility.ThreadScheduler
-import Control.Concurrent.Chan
+import Control.Concurrent.STM
import Control.Concurrent.Async
transport :: Transport
@@ -58,7 +58,7 @@ transport' r url transporthandle ichan ochan = do
return $ either (either id id) id status
- send msg = writeChan ochan msg
+ send msg = atomically $ writeTChan ochan msg
fetch = do
send (SYNCING url)
@@ -80,7 +80,7 @@ transport' r url transporthandle ichan ochan = do
Nothing -> return Stopping
handlecontrol = do
- msg <- readChan ichan
+ msg <- atomically $ readTChan ichan
case msg of
STOP -> return Stopping
LOSTNET -> return Stopping