summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-16 23:37:45 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-16 23:37:45 +0400
commit3d2408eb3f680117d841e5f90e120ff018009f03 (patch)
treef947ffa48de140fd25e399ce0dae608c7953c84f /src/Network/BitTorrent
parent1b01790a3a2913becf84cb11eb5909d1969e9853 (diff)
Remove askOption
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/DHT/Query.hs2
-rw-r--r--src/Network/BitTorrent/DHT/Session.hs10
2 files changed, 4 insertions, 8 deletions
diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs
index abe1ef5f..627bc096 100644
--- a/src/Network/BitTorrent/DHT/Query.hs
+++ b/src/Network/BitTorrent/DHT/Query.hs
@@ -137,5 +137,5 @@ publish ih p = do
137 137
138republish :: DHT ip ThreadId 138republish :: DHT ip ThreadId
139republish = fork $ do 139republish = fork $ do
140 i <- askOption optReannounce 140 i <- asks (optReannounce . options)
141 error "DHT.republish: not implemented" 141 error "DHT.republish: not implemented"
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs
index 33832aac..cbdc9ff8 100644
--- a/src/Network/BitTorrent/DHT/Session.hs
+++ b/src/Network/BitTorrent/DHT/Session.hs
@@ -20,17 +20,17 @@ module Network.BitTorrent.DHT.Session
20 , K 20 , K
21 , Options (..) 21 , Options (..)
22 22
23 -- * Node 23 -- * Session
24 , Node 24 , Node
25 , options 25 , options
26 , LogFun 26 , LogFun
27 , NodeHandler 27 , NodeHandler
28 , startNode 28 , startNode
29 29
30 -- * Session 30 -- * DHT
31 -- | Use @asks options@ to get options passed to 'startNode'.
31 , DHT 32 , DHT
32 , runDHT 33 , runDHT
33 , askOption
34 34
35 -- * Tokens 35 -- * Tokens
36 , grantToken 36 , grantToken
@@ -292,10 +292,6 @@ runDHT :: Node ip -> DHT ip a -> ResIO a
292runDHT node action = runReaderT (unDHT action) node 292runDHT node action = runReaderT (unDHT action) node
293{-# INLINE runDHT #-} 293{-# INLINE runDHT #-}
294 294
295askOption :: (Options -> a) -> DHT ip a
296askOption f = asks (f . options)
297{-# INLINE askOption #-}
298
299{----------------------------------------------------------------------- 295{-----------------------------------------------------------------------
300-- Routing 296-- Routing
301-----------------------------------------------------------------------} 297-----------------------------------------------------------------------}