packages feed

pipes-p2p 0.2 → 0.3

raw patch · 3 files changed

+8/−3 lines, 3 files

Files

CHANGELOG view
@@ -1,3 +1,8 @@+0.3+---+* Hotfix for `0.2` was wrong making it a brownbag release. This version should+  now work correctly.+ 0.2 --- * Make sure specified number of bytes are retrieved from socket.
pipes-p2p.cabal view
@@ -1,5 +1,5 @@ name:                pipes-p2p-version:             0.2+version:             0.3 cabal-version:       >=1.10 tested-with:         GHC == 7.6.3 build-type:          Simple
src/Pipes/Network/P2P.hs view
@@ -313,12 +313,12 @@  -- | Make sure the number of specified bytes are received from upstream. exhaust :: MonadIO m => Int -> Proxy Int ByteString Int ByteString m ()-exhaust n0 = forever $ go B.empty n0+exhaust = go B.empty   where     go !acc n = do bs <- request n                    let rl = B.length bs                    if rl == n-                   then respond $ acc <> bs+                   then respond (acc <> bs) >>= go B.empty                    else go (acc <> bs) (n - rl) {-# INLINABLE exhaust #-}