From 0968d03183996fb090bb7e8963eb97581538bfab Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sat, 7 Dec 2013 03:41:08 +0400 Subject: rename peerID field to peerId --- src/Network/BitTorrent/Core/PeerAddr.hs | 6 +++--- src/Network/BitTorrent/Exchange/Wire.hs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Network/BitTorrent') 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 -- | Peer address info normally extracted from peer list or peer -- compact list encoding. data PeerAddr = PeerAddr { - peerID :: !(Maybe PeerId) + peerId :: !(Maybe PeerId) , peerIP :: {-# UNPACK #-} !HostAddress , peerPort :: {-# UNPACK #-} !PortNumber } deriving (Show, Eq, Ord, Typeable) @@ -82,14 +82,14 @@ instance BEncode PeerAddr where -- For more info see: -- instance Serialize PeerAddr where - put PeerAddr {..} = put peerID >> put peerPort + put PeerAddr {..} = put peerId >> put peerPort {-# INLINE put #-} get = PeerAddr Nothing <$> get <*> get {-# INLINE get #-} instance Pretty PeerAddr where pretty p @ PeerAddr {..} - | Just pid <- peerID = pretty (fingerprint pid) <+> "at" <+> paddr + | Just pid <- peerId = pretty (fingerprint pid) <+> "at" <+> paddr | otherwise = paddr where paddr = text (show (peerSockAddr p)) diff --git a/src/Network/BitTorrent/Exchange/Wire.hs b/src/Network/BitTorrent/Exchange/Wire.hs index 1cf14809..2c8eb316 100644 --- a/src/Network/BitTorrent/Exchange/Wire.hs +++ b/src/Network/BitTorrent/Exchange/Wire.hs @@ -233,7 +233,7 @@ connectWire hs addr extCaps wire = unless (hsInfoHash hs == hsInfoHash hs') $ do throwIO $ ProtocolError $ UnexpectedTopic (hsInfoHash hs') - unless (hsPeerId hs' == fromMaybe (hsPeerId hs') (peerID addr)) $ do + unless (hsPeerId hs' == fromMaybe (hsPeerId hs') (peerId addr)) $ do throwIO $ ProtocolError $ UnexpectedPeerId (hsPeerId hs') let caps = hsReserved hs <> hsReserved hs' -- cgit v1.2.3