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 --- bittorrent.cabal | 2 +- src/Network/BitTorrent/Core/Node.hs | 2 +- src/Network/BitTorrent/Core/PeerId.hs | 4 ++-- sub/bencoding | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bittorrent.cabal b/bittorrent.cabal index 0d4005a9..0208f0c2 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal @@ -128,7 +128,7 @@ library , base16-bytestring >= 0.1 , base32-bytestring >= 0.2 , base64-bytestring >= 1.0 - , bencoding >= 0.4.2.1 + , bencoding >= 0.4.3 , cereal >= 0.3.5 -- Time 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 $ diff --git a/sub/bencoding b/sub/bencoding index d80b4fbe..7244b867 160000 --- a/sub/bencoding +++ b/sub/bencoding @@ -1 +1 @@ -Subproject commit d80b4fbe1ffe8478a1c72b1e96bbc5b44991d96f +Subproject commit 7244b867ebafb7e7b03fd21f84ea11dd2846ff43 -- cgit v1.2.3