summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-03-03 03:12:36 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-03-03 03:12:36 +0400
commit6794c6843e625a3b61fec48e54167a13f5fd093b (patch)
tree60eb2bbaa1930f1f0bbfd61d0a6205a3c9cce526 /src/Network
parent33549b27af5c4686ffe6a216d32af164dda33cd3 (diff)
Minor changes
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/Exchange/Session.hs8
1 files changed, 5 insertions, 3 deletions
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
113 store <- openInfoDict ReadWriteEx rootPath dict 113 store <- openInfoDict ReadWriteEx rootPath dict
114 statusVar <- newMVar $ sessionStatus (BF.haveNone (totalPieces store)) 114 statusVar <- newMVar $ sessionStatus (BF.haveNone (totalPieces store))
115 (piPieceLength (idPieceInfo dict)) 115 (piPieceLength (idPieceInfo dict))
116 metadataVar <- newMVar undefined
117 infodictVar <- newMVar (cache dict)
116 chan <- newChan 118 chan <- newChan
117 return Session 119 return Session
118 { sessionPeerId = pid 120 { sessionPeerId = pid
119 , sessionTopic = idInfoHash dict 121 , sessionTopic = idInfoHash dict
120 122
121 , metadata = undefined 123 , metadata = metadataVar
122 , infodict = undefined 124 , infodict = infodictVar
123 125
124 , status = statusVar 126 , status = statusVar
125 , storage = store 127 , storage = store
@@ -136,7 +138,7 @@ newSession logFun addr rootPath dict = do
136closeSession :: Session -> IO () 138closeSession :: Session -> IO ()
137closeSession ses = do 139closeSession ses = do
138 deleteAll ses 140 deleteAll ses
139 undefined 141 error "closeSession"
140 142
141waitMetadata :: Session -> IO InfoDict 143waitMetadata :: Session -> IO InfoDict
142waitMetadata Session {..} = cachedValue <$> readMVar infodict 144waitMetadata Session {..} = cachedValue <$> readMVar infodict