diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-08-28 04:56:52 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-08-28 04:56:52 +0400 |
commit | 03841eb1f2e8e0d38833b8855a55e393fb4d766a (patch) | |
tree | e693750cc126f529dcbbd3db8709f508a7f101bf /src/Network/BitTorrent/Tracker/UDP.hs | |
parent | 54b20f9ac462105cd3857b9c8102954a725ef308 (diff) |
~ Adapt HTTP Tracker to new interface.
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 |