From 573a77fcd75e8bbb79ef44e9ac54a55817338a0d Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org> Date: Fri, 1 May 2015 21:08:49 +0530 Subject: [PATCH] remove hardcoded Peer Works fine for the Ubuntu torrent file, but not for the Debian torrent file. --- src/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index fa79ac3..65e2dd7 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -11,7 +11,7 @@ import Text.ParserCombinators.Parsec (ParseError) import FuncTorrent.Bencode (decode) import FuncTorrent.Logger (initLogger, logMessage, logStop) import FuncTorrent.Metainfo (Info(..), Metainfo(..), mkMetaInfo) -import FuncTorrent.Peer (Peer(..), handShake) +import FuncTorrent.Peer (handShake) import FuncTorrent.Tracker (tracker, peers, mkTrackerResponse) logError :: ParseError -> (String -> IO ()) -> IO () @@ -64,7 +64,7 @@ main = do Right peerResp -> do log $ "Peers List : " ++ (show . peers $ peerResp) let p1 = head (peers peerResp) - msg <- handShake (Peer "" "95.188.88.59" 27000) (infoHash m) peerId + msg <- handShake p1 (infoHash m) peerId log $ "handshake: " ++ (show msg) return () Left e -> log $ "Error" ++ unpack e -- 2.45.2