diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-16 20:40:05 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-16 20:40:05 +0400 |
commit | bc1c976e9175b4ac13430ba9c23ea8b099401e9e (patch) | |
tree | 67a0d7064d1c0f843e8efbdaa1e2b32e35f1955b /src/Network/BitTorrent/DHT/Protocol.hs | |
parent | 412919e88e1d60303f7a14134e37f27becf5f959 (diff) |
~ Fix some long standing warnings.
Diffstat (limited to 'src/Network/BitTorrent/DHT/Protocol.hs')
-rw-r--r-- | src/Network/BitTorrent/DHT/Protocol.hs | 9 |
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 | |||
36 | import Data.BEncode | 36 | import Data.BEncode |
37 | import Data.Torrent | 37 | import Data.Torrent |
38 | import Network.BitTorrent.Peer | 38 | import Network.BitTorrent.Peer |
39 | import Network.BitTorrent.Exchange.Protocol () | ||
39 | 40 | ||
40 | {----------------------------------------------------------------------- | 41 | {----------------------------------------------------------------------- |
41 | Node | 42 | Node |
@@ -50,11 +51,6 @@ type NodeId = ByteString | |||
50 | genNodeId :: IO NodeId | 51 | genNodeId :: IO NodeId |
51 | genNodeId = getEntropy 20 | 52 | genNodeId = getEntropy 20 |
52 | 53 | ||
53 | instance Serialize PortNumber where | ||
54 | get = fromIntegral <$> getWord16be | ||
55 | put = putWord16be . fromIntegral | ||
56 | |||
57 | |||
58 | data NodeAddr = NodeAddr { | 54 | data 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 | |||
70 | data NodeInfo = NodeInfo { | 65 | data 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 |
177 | checkToken :: NodeId -> Token -> NodeSession -> IO Bool | 172 | checkToken :: NodeId -> Token -> NodeSession -> IO Bool |
178 | checkToken nid token _ = return True | 173 | checkToken _ _ _ = return True |
179 | 174 | ||
180 | updateTimestamp :: NodeSession -> NodeId -> IO () | 175 | updateTimestamp :: NodeSession -> NodeId -> IO () |
181 | updateTimestamp = error "updateTimestamp" | 176 | updateTimestamp = error "updateTimestamp" |