From 6794c6843e625a3b61fec48e54167a13f5fd093b Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Mon, 3 Mar 2014 03:12:36 +0400 Subject: Minor changes --- src/Network/BitTorrent/Exchange/Session.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Network/BitTorrent/Exchange') diff --git a/src/Network/BitTorrent/Exchange/Session.hs b/src/Network/BitTorrent/Exchange/Session.hs index a0eaadaa..74d0cc87 100644 --- a/src/Network/BitTorrent/Exchange/Session.hs +++ b/src/Network/BitTorrent/Exchange/Session.hs @@ -113,13 +113,15 @@ newSession logFun addr rootPath dict = do store <- openInfoDict ReadWriteEx rootPath dict statusVar <- newMVar $ sessionStatus (BF.haveNone (totalPieces store)) (piPieceLength (idPieceInfo dict)) + metadataVar <- newMVar undefined + infodictVar <- newMVar (cache dict) chan <- newChan return Session { sessionPeerId = pid , sessionTopic = idInfoHash dict - , metadata = undefined - , infodict = undefined + , metadata = metadataVar + , infodict = infodictVar , status = statusVar , storage = store @@ -136,7 +138,7 @@ newSession logFun addr rootPath dict = do closeSession :: Session -> IO () closeSession ses = do deleteAll ses - undefined + error "closeSession" waitMetadata :: Session -> IO InfoDict waitMetadata Session {..} = cachedValue <$> readMVar infodict -- cgit v1.2.3