summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-02-09 23:36:58 -0500
committerjoe <joe@jerkface.net>2014-02-09 23:36:58 -0500
commite710ed2434496f7891363def81c1c8756eadd129 (patch)
treeed6022cf97f54af6fd30533062bc96b92e5e40a2 /Presence
parent1b0182eae555aeb2952e40a522bd5215ae0fc6d9 (diff)
extra careful ping bump
Diffstat (limited to 'Presence')
-rw-r--r--Presence/Server.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Presence/Server.hs b/Presence/Server.hs
index da0cda17..c7162265 100644
--- a/Presence/Server.hs
+++ b/Presence/Server.hs
@@ -622,8 +622,13 @@ pingCancel me = do
622pingBump :: PingMachine -> IO () 622pingBump :: PingMachine -> IO ()
623pingBump me = do 623pingBump me = do
624 b <- atomically $ do 624 b <- atomically $ do
625 when (pingIdle me /= 0) $ 625 when (pingIdle me /= 0) $ do
626 putTMVar (pingDelay me) (1000*pingIdle me,PingIdle) 626 e <- tryReadTMVar (pingDelay me)
627 case e of
628 Just (0,PingTimeOut) -> return () -- canceled/fired
629 Just _ -> retry
630 Nothing -> putTMVar (pingDelay me)
631 (1000*pingIdle me,PingIdle)
627 readTVar (pingStarted me) 632 readTVar (pingStarted me)
628 when b $ throwTo (pingThread me) $ ErrorCall "" 633 when b $ throwTo (pingThread me) $ ErrorCall ""
629 634