diff options
author | joe <joe@jerkface.net> | 2017-06-06 21:05:23 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-06-06 21:05:23 -0400 |
commit | cb1a1fb883527c1c6075c97d7262e41729a9b924 (patch) | |
tree | 7d673d59c2fc68057b2c2d87c1a407e1938efb4d /src/Network/BitTorrent/DHT/Session.hs | |
parent | 24df9a12a9240aaed8741d60e4b0b9cbf59a9fd9 (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.hs | 6 |
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 | |||
107 | import Network.KRPC as KRPC hiding (Options, def) | 107 | import Network.KRPC as KRPC hiding (Options, def) |
108 | import qualified Network.KRPC as KRPC (def) | 108 | import qualified Network.KRPC as KRPC (def) |
109 | import Network.KRPC.Message (KMessageOf) | 109 | import Network.KRPC.Message (KMessageOf) |
110 | #ifdef VERSION_bencoding | ||
110 | import Data.BEncode (BValue) | 111 | import Data.BEncode (BValue) |
112 | #endif | ||
111 | import Network.BitTorrent.Address | 113 | import Network.BitTorrent.Address |
112 | import Network.BitTorrent.DHT.ContactInfo (PeerStore) | 114 | import Network.BitTorrent.DHT.ContactInfo (PeerStore) |
113 | import qualified Network.BitTorrent.DHT.ContactInfo as P | 115 | import 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 | ||
317 | type NodeHandler ip = Handler (DHT ip) KMessageOf BValue | 320 | type NodeHandler ip = Handler (DHT ip) KMessageOf BValue |
321 | #else | ||
322 | type 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 |