From 04815747e3a9b80ee2fbe37a8e5636ab42c33bdf Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Mon, 24 Feb 2014 02:26:05 +0400 Subject: Minor changes --- src/Network/BitTorrent/DHT.hs | 4 +++- src/Network/BitTorrent/DHT/Session.hs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Network/BitTorrent') diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index 44c55128..98ba1a56 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs @@ -156,7 +156,7 @@ isBootstrapped = T.full <$> getTable -- -- This is blocking operation, use -- 'Control.Concurrent.Async.Lifted.async' if needed. -restore :: ByteString -> DHT ip () +restore :: ByteString -> IO (Node ip) restore = error "DHT.restore: not implemented" -- | Serialize current DHT session to byte string. @@ -179,6 +179,8 @@ lookup topic = do -- TODO retry getClosest if bucket is empty closest <- lift $ getClosest topic sourceList [closest] $= search topic (getPeersQ topic) +-- TODO do not republish if the topic is already in announceSet + -- | Announce that /this/ peer may have some pieces of the specified -- torrent. DHT will reannounce this data periodically using -- 'optReannounce' interval. diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 43bd65e5..755985fc 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs @@ -212,6 +212,7 @@ nullSessionTokens = SessionTokens <*> liftIO getCurrentTime <*> pure defaultUpdateInterval +-- TODO invalidate *twice* if needed invalidateTokens :: UTCTime -> SessionTokens -> SessionTokens invalidateTokens curTime ts @ SessionTokens {..} | curTime `diffUTCTime` lastUpdate > maxInterval = SessionTokens -- cgit v1.2.3