summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/PeerWire/Message.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/PeerWire/Message.hs')
-rw-r--r--src/Network/BitTorrent/PeerWire/Message.hs18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/Network/BitTorrent/PeerWire/Message.hs b/src/Network/BitTorrent/PeerWire/Message.hs
index 1bcb2ee5..66021487 100644
--- a/src/Network/BitTorrent/PeerWire/Message.hs
+++ b/src/Network/BitTorrent/PeerWire/Message.hs
@@ -25,15 +25,6 @@ data Message = KeepAlive
25 | Port Int 25 | Port Int
26 deriving (Show, Eq) 26 deriving (Show, Eq)
27 27
28instance Serialize BlockIx where
29 {-# SPECIALIZE instance Serialize BlockIx #-}
30 get = BlockIx <$> getInt <*> getInt <*> getInt
31 {-# INLINE get #-}
32
33 put ix = do putInt (ixPiece ix)
34 putInt (ixOffset ix)
35 putInt (ixLength ix)
36 {-# INLINE put #-}
37 28
38instance Serialize Message where 29instance Serialize Message where
39 get = do 30 get = do
@@ -80,12 +71,3 @@ instance Serialize Message where
80 71
81 put (Cancel blk) = putInt 13 >> putWord8 8 >> put blk 72 put (Cancel blk) = putInt 13 >> putWord8 8 >> put blk
82 put (Port p ) = putInt 3 >> putWord8 9 >> putWord16be (fromIntegral p) 73 put (Port p ) = putInt 3 >> putWord8 9 >> putWord16be (fromIntegral p)
83
84
85getInt :: Get Int
86getInt = fromIntegral <$> getWord32be
87{-# INLINE getInt #-}
88
89putInt :: Putter Int
90putInt = putWord32be . fromIntegral
91{-# INLINE putInt #-}