From 17be47e8f10907ff1479a83595ef5fb920b6acbd Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Fri, 20 Dec 2013 20:29:29 +0400 Subject: Bump bencoding dependency --- src/Network/BitTorrent/Core/Node.hs | 2 +- src/Network/BitTorrent/Core/PeerId.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Network/BitTorrent/Core') diff --git a/src/Network/BitTorrent/Core/Node.hs b/src/Network/BitTorrent/Core/Node.hs index c629df08..a1a87135 100644 --- a/src/Network/BitTorrent/Core/Node.hs +++ b/src/Network/BitTorrent/Core/Node.hs @@ -37,7 +37,7 @@ import Network.BitTorrent.Core.PeerAddr () -- | Normally, /this/ node id should we saved between invocations of -- the client software. newtype NodeId = NodeId ByteString - deriving (Show, Eq, Ord, FromJSON, ToJSON) + deriving (Show, Eq, Ord, BEncode, FromJSON, ToJSON) nodeIdSize :: Int nodeIdSize = 20 diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs index f30308d4..cab30331 100644 --- a/src/Network/BitTorrent/Core/PeerId.hs +++ b/src/Network/BitTorrent/Core/PeerId.hs @@ -305,7 +305,7 @@ fingerprint pid = either (const def) id $ runGet getCI (getPeerId pid) 'e' -> Fingerprint <$> getBitCometImpl <*> getBitCometVersion 'F' -> Fingerprint <$> getBitCometImpl <*> getBitCometVersion c -> do - c1 <- w2c <$> lookAhead getWord8 + c1 <- w2c <$> S.lookAhead getWord8 if c1 == 'P' then do _ <- getWord8 @@ -324,7 +324,7 @@ fingerprint pid = either (const def) id $ runGet getCI (getPeerId pid) getBitCometImpl = do bs <- getByteString 3 - lookAhead $ do + S.lookAhead $ do _ <- getByteString 2 lr <- getByteString 4 return $ -- cgit v1.2.3