summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT/Protocol.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-16 20:40:05 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-16 20:40:05 +0400
commitbc1c976e9175b4ac13430ba9c23ea8b099401e9e (patch)
tree67a0d7064d1c0f843e8efbdaa1e2b32e35f1955b /src/Network/BitTorrent/DHT/Protocol.hs
parent412919e88e1d60303f7a14134e37f27becf5f959 (diff)
~ Fix some long standing warnings.
Diffstat (limited to 'src/Network/BitTorrent/DHT/Protocol.hs')
-rw-r--r--src/Network/BitTorrent/DHT/Protocol.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Network/BitTorrent/DHT/Protocol.hs b/src/Network/BitTorrent/DHT/Protocol.hs
index 5267a916..5cc1722d 100644
--- a/src/Network/BitTorrent/DHT/Protocol.hs
+++ b/src/Network/BitTorrent/DHT/Protocol.hs
@@ -36,6 +36,7 @@ import Remote.KRPC.Protocol
36import Data.BEncode 36import Data.BEncode
37import Data.Torrent 37import Data.Torrent
38import Network.BitTorrent.Peer 38import Network.BitTorrent.Peer
39import Network.BitTorrent.Exchange.Protocol ()
39 40
40{----------------------------------------------------------------------- 41{-----------------------------------------------------------------------
41 Node 42 Node
@@ -50,11 +51,6 @@ type NodeId = ByteString
50genNodeId :: IO NodeId 51genNodeId :: IO NodeId
51genNodeId = getEntropy 20 52genNodeId = getEntropy 20
52 53
53instance Serialize PortNumber where
54 get = fromIntegral <$> getWord16be
55 put = putWord16be . fromIntegral
56
57
58data NodeAddr = NodeAddr { 54data NodeAddr = NodeAddr {
59 nodeIP :: {-# UNPACK #-} !HostAddress 55 nodeIP :: {-# UNPACK #-} !HostAddress
60 , nodePort :: {-# UNPACK #-} !PortNumber 56 , nodePort :: {-# UNPACK #-} !PortNumber
@@ -66,7 +62,6 @@ instance Serialize NodeAddr where
66 putWord32be nodeIP 62 putWord32be nodeIP
67 put nodePort 63 put nodePort
68 64
69
70data NodeInfo = NodeInfo { 65data NodeInfo = NodeInfo {
71 nodeID :: !NodeId 66 nodeID :: !NodeId
72 , nodeAddr :: !NodeAddr 67 , nodeAddr :: !NodeAddr
@@ -175,7 +170,7 @@ assignToken _ _ = return ""
175 170
176-- TODO 171-- TODO
177checkToken :: NodeId -> Token -> NodeSession -> IO Bool 172checkToken :: NodeId -> Token -> NodeSession -> IO Bool
178checkToken nid token _ = return True 173checkToken _ _ _ = return True
179 174
180updateTimestamp :: NodeSession -> NodeId -> IO () 175updateTimestamp :: NodeSession -> NodeId -> IO ()
181updateTimestamp = error "updateTimestamp" 176updateTimestamp = error "updateTimestamp"