diff options
Diffstat (limited to 'src/Network/BitTorrent/Tracker/UDP.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker/UDP.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/UDP.hs b/src/Network/BitTorrent/Tracker/UDP.hs index e5475a23..dc1b4897 100644 --- a/src/Network/BitTorrent/Tracker/UDP.hs +++ b/src/Network/BitTorrent/Tracker/UDP.hs | |||
@@ -15,7 +15,6 @@ | |||
15 | {-# LANGUAGE TypeFamilies #-} | 15 | {-# LANGUAGE TypeFamilies #-} |
16 | module Network.BitTorrent.Tracker.UDP | 16 | module Network.BitTorrent.Tracker.UDP |
17 | ( UDPTracker | 17 | ( UDPTracker |
18 | , initialTracker | ||
19 | 18 | ||
20 | -- * Debug | 19 | -- * Debug |
21 | , putTracker | 20 | , putTracker |
@@ -316,8 +315,8 @@ scrapeUDP tracker scr = do | |||
316 | freshConnection tracker | 315 | freshConnection tracker |
317 | resp <- transaction tracker (Scrape scr) | 316 | resp <- transaction tracker (Scrape scr) |
318 | case resp of | 317 | case resp of |
319 | Scraped scrape -> return $ M.fromList $ L.zip scr scrape | 318 | Scraped info -> return $ M.fromList $ L.zip scr info |
320 | _ -> fail "scrape: response type mismatch" | 319 | _ -> fail "scrape: response type mismatch" |
321 | 320 | ||
322 | {----------------------------------------------------------------------- | 321 | {----------------------------------------------------------------------- |
323 | Retransmission | 322 | Retransmission |
@@ -342,6 +341,8 @@ retransmission action = go minTimeout | |||
342 | maybe (go (2 * curTimeout)) return r | 341 | maybe (go (2 * curTimeout)) return r |
343 | 342 | ||
344 | {----------------------------------------------------------------------} | 343 | {----------------------------------------------------------------------} |
344 | |||
345 | instance Tracker UDPTracker where | 345 | instance Tracker UDPTracker where |
346 | connect = initialTracker | ||
346 | announce t = retransmission . announceUDP t | 347 | announce t = retransmission . announceUDP t |
347 | scrape_ t = retransmission . scrapeUDP t | 348 | scrape t = retransmission . scrapeUDP t |