diff options
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Protocol.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Protocol.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Protocol.hs b/src/Network/BitTorrent/Exchange/Protocol.hs index 83774f06..a285f8d2 100644 --- a/src/Network/BitTorrent/Exchange/Protocol.hs +++ b/src/Network/BitTorrent/Exchange/Protocol.hs | |||
@@ -435,7 +435,7 @@ instance Serialize Message where | |||
435 | 435 | ||
436 | instance Binary Message where | 436 | instance Binary Message where |
437 | get = do | 437 | get = do |
438 | len <- undefined --getInt | 438 | len <- getIntB |
439 | -- _ <- lookAhead $ ensure len | 439 | -- _ <- lookAhead $ ensure len |
440 | if len == 0 then return KeepAlive | 440 | if len == 0 then return KeepAlive |
441 | else do | 441 | else do |
@@ -463,7 +463,7 @@ instance Binary Message where | |||
463 | 463 | ||
464 | where | 464 | where |
465 | getBlock :: Int -> B.Get Block | 465 | getBlock :: Int -> B.Get Block |
466 | getBlock len = Block <$> getIntB <*> getIntB <*> B.getBytes len | 466 | getBlock len = Block <$> getIntB <*> getIntB <*> B.getByteString len |
467 | {-# INLINE getBlock #-} | 467 | {-# INLINE getBlock #-} |
468 | 468 | ||
469 | put KeepAlive = putIntB 0 | 469 | put KeepAlive = putIntB 0 |