diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-07 03:41:08 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-07 03:41:08 +0400 |
commit | 0968d03183996fb090bb7e8963eb97581538bfab (patch) | |
tree | b7982e2b7087979aaa1012178317f79a77b4a1b2 /src/Network/BitTorrent/Core | |
parent | 10cebfb3bf311d386af2a849c13e5e99bd975f57 (diff) |
rename peerID field to peerId
Diffstat (limited to 'src/Network/BitTorrent/Core')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs index 5173c4fc..77f042d5 100644 --- a/src/Network/BitTorrent/Core/PeerAddr.hs +++ b/src/Network/BitTorrent/Core/PeerAddr.hs | |||
@@ -56,7 +56,7 @@ instance Serialize PortNumber where | |||
56 | -- | Peer address info normally extracted from peer list or peer | 56 | -- | Peer address info normally extracted from peer list or peer |
57 | -- compact list encoding. | 57 | -- compact list encoding. |
58 | data PeerAddr = PeerAddr { | 58 | data PeerAddr = PeerAddr { |
59 | peerID :: !(Maybe PeerId) | 59 | peerId :: !(Maybe PeerId) |
60 | , peerIP :: {-# UNPACK #-} !HostAddress | 60 | , peerIP :: {-# UNPACK #-} !HostAddress |
61 | , peerPort :: {-# UNPACK #-} !PortNumber | 61 | , peerPort :: {-# UNPACK #-} !PortNumber |
62 | } deriving (Show, Eq, Ord, Typeable) | 62 | } deriving (Show, Eq, Ord, Typeable) |
@@ -82,14 +82,14 @@ instance BEncode PeerAddr where | |||
82 | -- For more info see: <http://www.bittorrent.org/beps/bep_0023.html> | 82 | -- For more info see: <http://www.bittorrent.org/beps/bep_0023.html> |
83 | -- | 83 | -- |
84 | instance Serialize PeerAddr where | 84 | instance Serialize PeerAddr where |
85 | put PeerAddr {..} = put peerID >> put peerPort | 85 | put PeerAddr {..} = put peerId >> put peerPort |
86 | {-# INLINE put #-} | 86 | {-# INLINE put #-} |
87 | get = PeerAddr Nothing <$> get <*> get | 87 | get = PeerAddr Nothing <$> get <*> get |
88 | {-# INLINE get #-} | 88 | {-# INLINE get #-} |
89 | 89 | ||
90 | instance Pretty PeerAddr where | 90 | instance Pretty PeerAddr where |
91 | pretty p @ PeerAddr {..} | 91 | pretty p @ PeerAddr {..} |
92 | | Just pid <- peerID = pretty (fingerprint pid) <+> "at" <+> paddr | 92 | | Just pid <- peerId = pretty (fingerprint pid) <+> "at" <+> paddr |
93 | | otherwise = paddr | 93 | | otherwise = paddr |
94 | where | 94 | where |
95 | paddr = text (show (peerSockAddr p)) | 95 | paddr = text (show (peerSockAddr p)) |