diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-13 06:16:49 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-13 06:16:49 +0400 |
commit | 6fc2cec0666b4cadf72f89f4027ffb6cffadae12 (patch) | |
tree | 137ac6cad3d4a299a9c4fe62e3aff1090b239a9f /src/Network/BitTorrent/Exchange.hs | |
parent | bdc0a54c1137a1cb34d0659131a95c64276998da (diff) |
~ Use safe spawnP2P.
Diffstat (limited to 'src/Network/BitTorrent/Exchange.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Exchange.hs b/src/Network/BitTorrent/Exchange.hs index 5be9ae73..a0e7df8c 100644 --- a/src/Network/BitTorrent/Exchange.hs +++ b/src/Network/BitTorrent/Exchange.hs | |||
@@ -171,10 +171,7 @@ runP2P se addr p2p = waitVacancy se $ runSession se addr p2p | |||
171 | -- some other loop. Note that this function may block while waiting | 171 | -- some other loop. Note that this function may block while waiting |
172 | -- for a vacant place: use forkIO and runP2P instead. | 172 | -- for a vacant place: use forkIO and runP2P instead. |
173 | spawnP2P :: SwarmSession -> PeerAddr -> P2P () -> IO ThreadId | 173 | spawnP2P :: SwarmSession -> PeerAddr -> P2P () -> IO ThreadId |
174 | spawnP2P se addr p2p = do | 174 | spawnP2P se addr p2p = forkThrottle se $ runSession se addr p2p |
175 | enterSwarm se | ||
176 | forkIO $ do | ||
177 | runSession se addr p2p `finally` leaveSwarm se | ||
178 | 175 | ||
179 | -- TODO unify this all using PeerConnection | 176 | -- TODO unify this all using PeerConnection |
180 | {- | 177 | {- |