diff options
Diffstat (limited to 'src/Network/BitTorrent/Tracker.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Tracker.hs b/src/Network/BitTorrent/Tracker.hs index cb776431..e1f9ff76 100644 --- a/src/Network/BitTorrent/Tracker.hs +++ b/src/Network/BitTorrent/Tracker.hs | |||
@@ -172,6 +172,7 @@ withTracker initProgress conn action = bracket start end (action . fst) | |||
172 | where | 172 | where |
173 | start = do | 173 | start = do |
174 | resp <- askTracker (startedReq conn initProgress) | 174 | resp <- askTracker (startedReq conn initProgress) |
175 | print resp | ||
175 | se <- newSession initProgress (respInterval resp) (respPeers resp) | 176 | se <- newSession initProgress (respInterval resp) (respPeers resp) |
176 | tid <- forkIO (syncSession se) | 177 | tid <- forkIO (syncSession se) |
177 | return (se, tid) | 178 | return (se, tid) |
@@ -179,10 +180,13 @@ withTracker initProgress conn action = bracket start end (action . fst) | |||
179 | syncSession se @ TSession {..} = forever $ do | 180 | syncSession se @ TSession {..} = forever $ do |
180 | waitInterval se | 181 | waitInterval se |
181 | pr <- getProgress se | 182 | pr <- getProgress se |
183 | print "tracker req" | ||
182 | resp <- tryJust isIOException $ do | 184 | resp <- tryJust isIOException $ do |
183 | askTracker (regularReq defaultNumWant conn pr) | 185 | askTracker (regularReq defaultNumWant conn pr) |
186 | print "tracker resp" | ||
184 | case resp of | 187 | case resp of |
185 | Right (OK {..}) -> do | 188 | Right (ok @ OK {..}) -> do |
189 | print ok | ||
186 | writeIORef seInterval respInterval | 190 | writeIORef seInterval respInterval |
187 | writeList2Chan sePeers respPeers | 191 | writeList2Chan sePeers respPeers |
188 | _ -> return () | 192 | _ -> return () |