summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-19 06:39:13 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-19 06:39:13 +0400
commit03e4888687698d8a8d421c9f894bcabf0e950568 (patch)
tree095696eaca2050b2d4b5302d64840daf85a26150 /src/Network/BitTorrent
parent6e9b81c9009140db4807bd51baadcf3be785ee15 (diff)
Rename handlers to defaultHandlers
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Client.hs2
-rw-r--r--src/Network/BitTorrent/DHT.hs6
-rw-r--r--src/Network/BitTorrent/DHT/Query.hs6
3 files changed, 7 insertions, 7 deletions
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
94 tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort) 94 tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort)
95 emgr <- Exchange.newManager (exchangeOptions pid opts) connHandler 95 emgr <- Exchange.newManager (exchangeOptions pid opts) connHandler
96 node <- do 96 node <- do
97 node <- startNode handlers def optNodeAddr logger 97 node <- startNode defaultHandlers def optNodeAddr logger
98 runDHT node $ bootstrap (maybeToList optBootNode) 98 runDHT node $ bootstrap (maybeToList optBootNode)
99 return node 99 return node
100 return Client 100 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
43 -- ** Session 43 -- ** Session
44 , LogFun 44 , LogFun
45 , Node 45 , Node
46 , handlers 46 , defaultHandlers
47 , startNode 47 , startNode
48 , stopNode 48 , stopNode
49 49
@@ -87,8 +87,8 @@ dht :: Address ip
87 -> IO a -- ^ result. 87 -> IO a -- ^ result.
88dht opts addr action = do 88dht opts addr action = do
89 runStderrLoggingT $ LoggingT $ \ logger -> do 89 runStderrLoggingT $ LoggingT $ \ logger -> do
90 bracket (startNode handlers opts addr logger) stopNode $ \ node -> 90 bracket (startNode defaultHandlers opts addr logger) stopNode $
91 runDHT node action 91 \ node -> runDHT node action
92{-# INLINE dht #-} 92{-# INLINE dht #-}
93 93
94{----------------------------------------------------------------------- 94{-----------------------------------------------------------------------
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
6 , findNodeH 6 , findNodeH
7 , getPeersH 7 , getPeersH
8 , announceH 8 , announceH
9 , handlers 9 , defaultHandlers
10 10
11 -- * Search 11 -- * Search
12 -- ** Step 12 -- ** Step
@@ -81,8 +81,8 @@ announceH = nodeHandler $ \ naddr @ NodeAddr {..} (Announce {..}) -> do
81 return Announced 81 return Announced
82 82
83-- | Includes all query handlers. 83-- | Includes all query handlers.
84handlers :: Address ip => [NodeHandler ip] 84defaultHandlers :: Address ip => [NodeHandler ip]
85handlers = [pingH, findNodeH, getPeersH, announceH] 85defaultHandlers = [pingH, findNodeH, getPeersH, announceH]
86 86
87{----------------------------------------------------------------------- 87{-----------------------------------------------------------------------
88-- Search 88-- Search