From 03e4888687698d8a8d421c9f894bcabf0e950568 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Wed, 19 Feb 2014 06:39:13 +0400 Subject: Rename handlers to defaultHandlers --- src/Network/BitTorrent/Client.hs | 2 +- src/Network/BitTorrent/DHT.hs | 6 +++--- src/Network/BitTorrent/DHT/Query.hs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Network') diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs index 9b53ad6d..7a50b6ba 100644 --- a/src/Network/BitTorrent/Client.hs +++ b/src/Network/BitTorrent/Client.hs @@ -94,7 +94,7 @@ newClient opts @ Options {..} logger = do tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort) emgr <- Exchange.newManager (exchangeOptions pid opts) connHandler node <- do - node <- startNode handlers def optNodeAddr logger + node <- startNode defaultHandlers def optNodeAddr logger runDHT node $ bootstrap (maybeToList optBootNode) return node return Client diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index 080a0fc0..cdc5124b 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs @@ -43,7 +43,7 @@ module Network.BitTorrent.DHT -- ** Session , LogFun , Node - , handlers + , defaultHandlers , startNode , stopNode @@ -87,8 +87,8 @@ dht :: Address ip -> IO a -- ^ result. dht opts addr action = do runStderrLoggingT $ LoggingT $ \ logger -> do - bracket (startNode handlers opts addr logger) stopNode $ \ node -> - runDHT node action + bracket (startNode defaultHandlers opts addr logger) stopNode $ + \ node -> runDHT node action {-# INLINE dht #-} {----------------------------------------------------------------------- diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index 714e9559..b9f12649 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs @@ -6,7 +6,7 @@ module Network.BitTorrent.DHT.Query , findNodeH , getPeersH , announceH - , handlers + , defaultHandlers -- * Search -- ** Step @@ -81,8 +81,8 @@ announceH = nodeHandler $ \ naddr @ NodeAddr {..} (Announce {..}) -> do return Announced -- | Includes all query handlers. -handlers :: Address ip => [NodeHandler ip] -handlers = [pingH, findNodeH, getPeersH, announceH] +defaultHandlers :: Address ip => [NodeHandler ip] +defaultHandlers = [pingH, findNodeH, getPeersH, announceH] {----------------------------------------------------------------------- -- Search -- cgit v1.2.3