From: Ramakrishnan Muthukrishnan Date: Sat, 3 Oct 2015 04:21:45 +0000 (+0530) Subject: Tracker: remove vestiges of the older code and module imports X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/%22file:/frontends//%22%22?a=commitdiff_plain;h=45ae804a31ff9e9db9bc9ec3a1a29230ee48a033;p=functorrent.git Tracker: remove vestiges of the older code and module imports --- diff --git a/src/FuncTorrent/Tracker.hs b/src/FuncTorrent/Tracker.hs index 11cecd5..3926a12 100644 --- a/src/FuncTorrent/Tracker.hs +++ b/src/FuncTorrent/Tracker.hs @@ -8,8 +8,7 @@ module FuncTorrent.Tracker import Prelude hiding (lookup, splitAt) import Control.Concurrent (threadDelay) -import Control.Concurrent.MVar (MVar, newEmptyMVar, newMVar, readMVar, putMVar, takeMVar) -import Control.Monad.State +import Control.Concurrent.MVar (MVar, newEmptyMVar, newMVar, readMVar, putMVar) import Data.ByteString (ByteString) import Data.ByteString.Char8 as BC (pack, unpack, splitAt) import Data.Char (chr) @@ -123,9 +122,9 @@ mkArgs port peer_id up down m = trackerLoop :: PortNumber -> String -> Metainfo -> TState -> IO ByteString trackerLoop port peerId m st = do - up <- liftIO $ readMVar $ uploaded st - down <- liftIO $ readMVar $ downloaded st - resp <- liftIO $ sendGetRequest (head . announceList $ m) $ mkArgs port peerId up down m + up <- readMVar $ uploaded st + down <- readMVar $ downloaded st + resp <- sendGetRequest (head . announceList $ m) $ mkArgs port peerId up down m case decode resp of Left e -> return $ pack (show e) Right trackerInfo ->