diff options
Diffstat (limited to 'dht/src/Network/Tox/AggregateSession.hs')
-rw-r--r-- | dht/src/Network/Tox/AggregateSession.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dht/src/Network/Tox/AggregateSession.hs b/dht/src/Network/Tox/AggregateSession.hs index 44bbf9b9..c657f4d9 100644 --- a/dht/src/Network/Tox/AggregateSession.hs +++ b/dht/src/Network/Tox/AggregateSession.hs | |||
@@ -269,12 +269,12 @@ addSession c s = do | |||
269 | forkSession c s $ \progress -> do | 269 | forkSession c s $ \progress -> do |
270 | status0 <- aggregateStatus c | 270 | status0 <- aggregateStatus c |
271 | writeTVar (singleStatus con) progress | 271 | writeTVar (singleStatus con) progress |
272 | emap' <- do | 272 | let sid = sSessionID s |
273 | emap <- readTVar (contactEstablished c) | 273 | modifyTVar' (contactEstablished c) $ case progress of |
274 | return $ case progress of | 274 | Established -> IntMap.insert sid () |
275 | Established -> IntMap.insert (sSessionID s) () emap | 275 | _ -> IntMap.delete sid |
276 | _ -> IntMap.delete (sSessionID s) emap | 276 | when (progress == Dormant) $ |
277 | writeTVar (contactEstablished c) emap' | 277 | modifyTVar' (contactSession c) (IntMap.delete sid) |
278 | status <- aggregateStatus c | 278 | status <- aggregateStatus c |
279 | when (status /= status0) $ notifyState c c s status | 279 | when (status /= status0) $ notifyState c c s status |
280 | mapM_ (delSession c) closed | 280 | mapM_ (delSession c) closed |