diff options
-rw-r--r-- | src/Network/Torrent/Handshake.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/Torrent/Handshake.hs b/src/Network/Torrent/Handshake.hs index b17afaf7..c14fd591 100644 --- a/src/Network/Torrent/Handshake.hs +++ b/src/Network/Torrent/Handshake.hs | |||
@@ -26,7 +26,7 @@ data Handshake = Handshake { | |||
26 | 26 | ||
27 | instance Serialize Handshake where | 27 | instance Serialize Handshake where |
28 | put hs = do | 28 | put hs = do |
29 | putWord8 (49 + fromIntegral (B.length (hsProtocol hs))) | 29 | putWord8 (fromIntegral (B.length (hsProtocol hs))) |
30 | putByteString (hsProtocol hs) | 30 | putByteString (hsProtocol hs) |
31 | putWord64be (hsReserved hs) | 31 | putWord64be (hsReserved hs) |
32 | putByteString (hsInfoHash hs) | 32 | putByteString (hsInfoHash hs) |
@@ -34,7 +34,7 @@ instance Serialize Handshake where | |||
34 | 34 | ||
35 | get = do | 35 | get = do |
36 | len <- getWord8 | 36 | len <- getWord8 |
37 | Handshake <$> getBytes (fromIntegral (len - 49)) | 37 | Handshake <$> getBytes (fromIntegral len) |
38 | <*> getWord64be | 38 | <*> getWord64be |
39 | <*> getBytes 20 | 39 | <*> getBytes 20 |
40 | <*> get | 40 | <*> get |