summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT/Session.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-06-06 21:05:23 -0400
committerjoe <joe@jerkface.net>2017-06-06 21:05:23 -0400
commitcb1a1fb883527c1c6075c97d7262e41729a9b924 (patch)
tree7d673d59c2fc68057b2c2d87c1a407e1938efb4d /src/Network/BitTorrent/DHT/Session.hs
parent24df9a12a9240aaed8741d60e4b0b9cbf59a9fd9 (diff)
WIP: Adapting DHT to Tox network (part 3).
Diffstat (limited to 'src/Network/BitTorrent/DHT/Session.hs')
-rw-r--r--src/Network/BitTorrent/DHT/Session.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs
index db8e7cff..20dba595 100644
--- a/src/Network/BitTorrent/DHT/Session.hs
+++ b/src/Network/BitTorrent/DHT/Session.hs
@@ -107,7 +107,9 @@ import Data.Torrent as Torrent
107import Network.KRPC as KRPC hiding (Options, def) 107import Network.KRPC as KRPC hiding (Options, def)
108import qualified Network.KRPC as KRPC (def) 108import qualified Network.KRPC as KRPC (def)
109import Network.KRPC.Message (KMessageOf) 109import Network.KRPC.Message (KMessageOf)
110#ifdef VERSION_bencoding
110import Data.BEncode (BValue) 111import Data.BEncode (BValue)
112#endif
111import Network.BitTorrent.Address 113import Network.BitTorrent.Address
112import Network.BitTorrent.DHT.ContactInfo (PeerStore) 114import Network.BitTorrent.DHT.ContactInfo (PeerStore)
113import qualified Network.BitTorrent.DHT.ContactInfo as P 115import qualified Network.BitTorrent.DHT.ContactInfo as P
@@ -314,7 +316,11 @@ instance MonadLogger (DHT ip) where
314 logger <- asks loggerFun 316 logger <- asks loggerFun
315 liftIO $ logger loc src lvl (toLogStr msg) 317 liftIO $ logger loc src lvl (toLogStr msg)
316 318
319#ifdef VERSION_bencoding
317type NodeHandler ip = Handler (DHT ip) KMessageOf BValue 320type NodeHandler ip = Handler (DHT ip) KMessageOf BValue
321#else
322type NodeHandler ip = Handler (DHT ip) KMessageOf ByteString
323#endif
318 324
319-- | Run DHT session. You /must/ properly close session using 325-- | Run DHT session. You /must/ properly close session using
320-- 'closeNode' function, otherwise socket or other scarce resources may 326-- 'closeNode' function, otherwise socket or other scarce resources may