diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-03-03 03:12:36 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-03-03 03:12:36 +0400 |
commit | 6794c6843e625a3b61fec48e54167a13f5fd093b (patch) | |
tree | 60eb2bbaa1930f1f0bbfd61d0a6205a3c9cce526 /src | |
parent | 33549b27af5c4686ffe6a216d32af164dda33cd3 (diff) |
Minor changes
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Session.hs | 8 |
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 | |||
136 | closeSession :: Session -> IO () | 138 | closeSession :: Session -> IO () |
137 | closeSession ses = do | 139 | closeSession ses = do |
138 | deleteAll ses | 140 | deleteAll ses |
139 | undefined | 141 | error "closeSession" |
140 | 142 | ||
141 | waitMetadata :: Session -> IO InfoDict | 143 | waitMetadata :: Session -> IO InfoDict |
142 | waitMetadata Session {..} = cachedValue <$> readMVar infodict | 144 | waitMetadata Session {..} = cachedValue <$> readMVar infodict |