summaryrefslogtreecommitdiff
path: root/Connection/Tox.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Connection/Tox.hs')
-rw-r--r--Connection/Tox.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Connection/Tox.hs b/Connection/Tox.hs
index 03ffbc25..1cbbdaee 100644
--- a/Connection/Tox.hs
+++ b/Connection/Tox.hs
@@ -31,6 +31,7 @@ import GHC.Conc (labelThread)
31#endif 31#endif
32import GHC.Conc (ThreadStatus (..), threadStatus) 32import GHC.Conc (ThreadStatus (..), threadStatus)
33import System.IO 33import System.IO
34import DPut
34 35
35 36
36 37
@@ -81,7 +82,7 @@ launch lbl st f = do
81 tid <- forkIO (f stvar) 82 tid <- forkIO (f stvar)
82 labelThread tid lbl 83 labelThread tid lbl
83 stat <- threadStatus tid 84 stat <- threadStatus tid
84 hPutStrLn stderr $ "launch "++lbl++" "++show stat 85 dput XMan $ "launch "++lbl++" "++show stat
85 return $ StatefulTask tid stvar 86 return $ StatefulTask tid stvar
86 87
87 88
@@ -142,12 +143,12 @@ setToxPolicy :: Parameters extra
142 -> Policy 143 -> Policy
143 -> IO () 144 -> IO ()
144setToxPolicy params conmap k@(Key me them) policy = do 145setToxPolicy params conmap k@(Key me them) policy = do
145 hPutStrLn stderr $ "C.setToxPolicy "++show (them,policy) 146 dput XMan $ "C.setToxPolicy "++show (them,policy)
146 case policy of 147 case policy of
147 TryingToConnect -> do 148 TryingToConnect -> do
148 mst <- lookupForPolicyChange conmap k policy 149 mst <- lookupForPolicyChange conmap k policy
149 r <- atomically $ lookupContact k (roster params) 150 r <- atomically $ lookupContact k (roster params)
150 hPutStrLn stderr $ "C.r="++show (fmap (const ()) r) 151 dput XMan $ "C.r="++show (fmap (const ()) r)
151 forM_ r $ \(sec,c) -> do 152 forM_ r $ \(sec,c) -> do
152 let persue_methods = PersueContactMethods 153 let persue_methods = PersueContactMethods
153 { allsessions = sessions params 154 { allsessions = sessions params
@@ -178,7 +179,7 @@ setToxPolicy params conmap k@(Key me them) policy = do
178 fmap (fromMaybe G.Dormant) $ forM (Map.lookup (id2key them) sbk) $ \ss -> do 179 fmap (fromMaybe G.Dormant) $ forM (Map.lookup (id2key them) sbk) $ \ss -> do
179 stats <- mapM (readTVar . ncState) ss 180 stats <- mapM (readTVar . ncState) ss
180 return $ maximum stats 181 return $ maximum stats
181 hPutStrLn stderr $ "C.mst="++show (fmap (const ()) mst) 182 dput XMan $ "C.mst="++show (fmap (const ()) mst)
182 forM_ mst $ \st -> do 183 forM_ mst $ \st -> do
183 let getPolicy = readTVar $ connPolicy st 184 let getPolicy = readTVar $ connPolicy st
184 tasks <- atomically $ readTVar (handshakeTask st) 185 tasks <- atomically $ readTVar (handshakeTask st)