diff options
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 8 |
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 | ||
34 | import Control.Applicative | 34 | import Control.Applicative |
35 | import Control.Monad | 35 | import Control.Monad |
36 | import Data.Aeson (ToJSON, FromJSON) | ||
37 | import Data.Aeson.TH | ||
38 | import Data.BEncode as BS | 36 | import Data.BEncode as BS |
39 | import Data.BEncode.BDict (BKey) | 37 | import Data.BEncode.BDict (BKey) |
40 | import Data.ByteString.Char8 as BS8 | 38 | import Data.ByteString.Char8 as BS8 |
@@ -58,7 +56,6 @@ import Text.Read (readMaybe) | |||
58 | import qualified Text.ParserCombinators.ReadP as RP | 56 | import qualified Text.ParserCombinators.ReadP as RP |
59 | 57 | ||
60 | import Data.Torrent.InfoHash | 58 | import Data.Torrent.InfoHash |
61 | import Data.Torrent.JSON | ||
62 | import Network.BitTorrent.Core.PeerId | 59 | import 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 | ||
69 | deriving instance ToJSON PortNumber | ||
70 | deriving instance FromJSON PortNumber | ||
71 | |||
72 | instance BEncode PortNumber where | 66 | instance 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 | |||
213 | peer_ip_key, peer_id_key, peer_port_key :: BKey | 205 | peer_ip_key, peer_id_key, peer_port_key :: BKey |
214 | peer_ip_key = "ip" | 206 | peer_ip_key = "ip" |
215 | peer_id_key = "peer id" | 207 | peer_id_key = "peer id" |