summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Core/PeerAddr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r--src/Network/BitTorrent/Core/PeerAddr.hs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs
index adf64c7f..92fb83a7 100644
--- a/src/Network/BitTorrent/Core/PeerAddr.hs
+++ b/src/Network/BitTorrent/Core/PeerAddr.hs
@@ -33,8 +33,6 @@ module Network.BitTorrent.Core.PeerAddr
33 33
34import Control.Applicative 34import Control.Applicative
35import Control.Monad 35import Control.Monad
36import Data.Aeson (ToJSON, FromJSON)
37import Data.Aeson.TH
38import Data.BEncode as BS 36import Data.BEncode as BS
39import Data.BEncode.BDict (BKey) 37import Data.BEncode.BDict (BKey)
40import Data.ByteString.Char8 as BS8 38import Data.ByteString.Char8 as BS8
@@ -58,7 +56,6 @@ import Text.Read (readMaybe)
58import qualified Text.ParserCombinators.ReadP as RP 56import qualified Text.ParserCombinators.ReadP as RP
59 57
60import Data.Torrent.InfoHash 58import Data.Torrent.InfoHash
61import Data.Torrent.JSON
62import Network.BitTorrent.Core.PeerId 59import Network.BitTorrent.Core.PeerId
63 60
64 61
@@ -66,9 +63,6 @@ import Network.BitTorrent.Core.PeerId
66-- Port number 63-- Port number
67-----------------------------------------------------------------------} 64-----------------------------------------------------------------------}
68 65
69deriving instance ToJSON PortNumber
70deriving instance FromJSON PortNumber
71
72instance BEncode PortNumber where 66instance BEncode PortNumber where
73 toBEncode = toBEncode . fromEnum 67 toBEncode = toBEncode . fromEnum
74 fromBEncode = fromBEncode >=> portNumber 68 fromBEncode = fromBEncode >=> portNumber
@@ -208,8 +202,6 @@ data PeerAddr a = PeerAddr
208 , peerPort :: {-# UNPACK #-} !PortNumber 202 , peerPort :: {-# UNPACK #-} !PortNumber
209 } deriving (Show, Eq, Ord, Typeable, Functor) 203 } deriving (Show, Eq, Ord, Typeable, Functor)
210 204
211$(deriveJSON omitRecordPrefix ''PeerAddr)
212
213peer_ip_key, peer_id_key, peer_port_key :: BKey 205peer_ip_key, peer_id_key, peer_port_key :: BKey
214peer_ip_key = "ip" 206peer_ip_key = "ip"
215peer_id_key = "peer id" 207peer_id_key = "peer id"