From: Ramakrishnan Muthukrishnan Date: Fri, 1 May 2015 15:38:49 +0000 (+0530) Subject: remove hardcoded Peer X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/bcase/nxhtml.html?a=commitdiff_plain;h=573a77fcd75e8bbb79ef44e9ac54a55817338a0d;p=functorrent.git remove hardcoded Peer Works fine for the Ubuntu torrent file, but not for the Debian torrent file. --- 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