projects
/
functorrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc74235
)
receive the full handshake msg from peer
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Thu, 7 May 2015 05:53:17 +0000
(11:23 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Thu, 7 May 2015 05:53:17 +0000
(11:23 +0530)
src/FuncTorrent/Peer.hs
patch
|
blob
|
history
diff --git
a/src/FuncTorrent/Peer.hs
b/src/FuncTorrent/Peer.hs
index 353e08a9b759ebe51e15adb0edfd253549d8dcbd..95e29388d3829251189c7e7a96429c3c3f202561 100644
(file)
--- a/
src/FuncTorrent/Peer.hs
+++ b/
src/FuncTorrent/Peer.hs
@@
-71,9
+71,8
@@
handShake (Peer _ ip port) infoHash peerid = do
h <- connectTo ip (PortNumber (fromIntegral port))
hSetBuffering h LineBuffering
hPut h hs
- rlenBS <- hGet h 1
- let rlen = fromIntegral $ (unpack rlenBS) !! 0
- hGet h rlen
+ rlenBS <- hGet h (length (unpack hs))
+ putStrLn $ "got handshake from peer: " ++ show rlenBS
return h
instance Binary PeerMsg where