diff options
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r-- | src/Network/BitTorrent.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs index bb8eb800..ef144f1f 100644 --- a/src/Network/BitTorrent.hs +++ b/src/Network/BitTorrent.hs | |||
@@ -102,15 +102,13 @@ defaultClient = newClient defaultThreadCount defaultExtensions | |||
102 | -- thus we can obtain an unified interface | 102 | -- thus we can obtain an unified interface |
103 | 103 | ||
104 | discover :: SwarmSession -> P2P () -> IO () | 104 | discover :: SwarmSession -> P2P () -> IO () |
105 | discover swarm action = {-# SCC discover #-} do | 105 | discover swarm @ SwarmSession {..} action = {-# SCC discover #-} do |
106 | port <- forkListener (error "discover") | 106 | let conn = TConnection (tAnnounce torrentMeta) |
107 | (tInfoHash torrentMeta) | ||
108 | (clientPeerId clientSession) | ||
109 | (listenerPort clientSession) | ||
107 | 110 | ||
108 | let conn = TConnection (tAnnounce (torrentMeta swarm)) | 111 | progress <- getCurrentProgress clientSession |
109 | (tInfoHash (torrentMeta swarm)) | ||
110 | (clientPeerId (clientSession swarm)) | ||
111 | port | ||
112 | |||
113 | progress <- getCurrentProgress (clientSession swarm) | ||
114 | 112 | ||
115 | withTracker progress conn $ \tses -> do | 113 | withTracker progress conn $ \tses -> do |
116 | forever $ do | 114 | forever $ do |