diff options
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r-- | src/Network/BitTorrent/Tracker/Message.hs | 8 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker/Session.hs | 12 |
2 files changed, 0 insertions, 20 deletions
diff --git a/src/Network/BitTorrent/Tracker/Message.hs b/src/Network/BitTorrent/Tracker/Message.hs index ffe36c82..cdc07af8 100644 --- a/src/Network/BitTorrent/Tracker/Message.hs +++ b/src/Network/BitTorrent/Tracker/Message.hs | |||
@@ -97,7 +97,6 @@ module Network.BitTorrent.Tracker.Message | |||
97 | 97 | ||
98 | import Control.Applicative | 98 | import Control.Applicative |
99 | import Control.Monad | 99 | import Control.Monad |
100 | import Data.Aeson.TH | ||
101 | import Data.BEncode as BE hiding (Result) | 100 | import Data.BEncode as BE hiding (Result) |
102 | import Data.BEncode.BDict as BE | 101 | import Data.BEncode.BDict as BE |
103 | import Data.ByteString as BS | 102 | import Data.ByteString as BS |
@@ -126,7 +125,6 @@ import System.Entropy | |||
126 | import Text.Read (readMaybe) | 125 | import Text.Read (readMaybe) |
127 | 126 | ||
128 | import Data.Torrent.InfoHash | 127 | import Data.Torrent.InfoHash |
129 | import Data.Torrent.JSON | ||
130 | import Data.Torrent.Progress | 128 | import Data.Torrent.Progress |
131 | import Network.BitTorrent.Core | 129 | import Network.BitTorrent.Core |
132 | 130 | ||
@@ -150,8 +148,6 @@ data AnnounceEvent | |||
150 | | Completed | 148 | | Completed |
151 | deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) | 149 | deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) |
152 | 150 | ||
153 | $(deriveJSON omitRecordPrefix ''AnnounceEvent) | ||
154 | |||
155 | -- | HTTP tracker protocol compatible encoding. | 151 | -- | HTTP tracker protocol compatible encoding. |
156 | instance QueryValueLike AnnounceEvent where | 152 | instance QueryValueLike AnnounceEvent where |
157 | toQueryValue e = toQueryValue (Char.toLower x : xs) | 153 | toQueryValue e = toQueryValue (Char.toLower x : xs) |
@@ -224,8 +220,6 @@ data AnnounceQuery = AnnounceQuery | |||
224 | , reqEvent :: Maybe AnnounceEvent | 220 | , reqEvent :: Maybe AnnounceEvent |
225 | } deriving (Show, Eq, Typeable) | 221 | } deriving (Show, Eq, Typeable) |
226 | 222 | ||
227 | $(deriveJSON omitRecordPrefix ''AnnounceQuery) | ||
228 | |||
229 | -- | UDP tracker protocol compatible encoding. | 223 | -- | UDP tracker protocol compatible encoding. |
230 | instance Serialize AnnounceQuery where | 224 | instance Serialize AnnounceQuery where |
231 | put AnnounceQuery {..} = do | 225 | put AnnounceQuery {..} = do |
@@ -636,8 +630,6 @@ data ScrapeEntry = ScrapeEntry { | |||
636 | , siName :: !(Maybe Text) | 630 | , siName :: !(Maybe Text) |
637 | } deriving (Show, Eq, Typeable) | 631 | } deriving (Show, Eq, Typeable) |
638 | 632 | ||
639 | $(deriveJSON omitRecordPrefix ''ScrapeEntry) | ||
640 | |||
641 | -- | HTTP tracker protocol compatible encoding. | 633 | -- | HTTP tracker protocol compatible encoding. |
642 | instance BEncode ScrapeEntry where | 634 | instance BEncode ScrapeEntry where |
643 | toBEncode ScrapeEntry {..} = toDict $ | 635 | toBEncode ScrapeEntry {..} = toDict $ |
diff --git a/src/Network/BitTorrent/Tracker/Session.hs b/src/Network/BitTorrent/Tracker/Session.hs index 5aa9c0eb..560acf84 100644 --- a/src/Network/BitTorrent/Tracker/Session.hs +++ b/src/Network/BitTorrent/Tracker/Session.hs | |||
@@ -47,8 +47,6 @@ import Control.Exception | |||
47 | import Control.Concurrent | 47 | import Control.Concurrent |
48 | import Control.Concurrent.Chan.Split as CS | 48 | import Control.Concurrent.Chan.Split as CS |
49 | import Control.Monad | 49 | import Control.Monad |
50 | import Data.Aeson | ||
51 | import Data.Aeson.TH | ||
52 | import Data.Default | 50 | import Data.Default |
53 | import Data.Fixed | 51 | import Data.Fixed |
54 | import Data.Foldable as F | 52 | import Data.Foldable as F |
@@ -60,7 +58,6 @@ import Data.Traversable | |||
60 | import Network.URI | 58 | import Network.URI |
61 | 59 | ||
62 | import Data.Torrent.InfoHash | 60 | import Data.Torrent.InfoHash |
63 | import Data.Torrent.JSON | ||
64 | import Network.BitTorrent.Core | 61 | import Network.BitTorrent.Core |
65 | import Network.BitTorrent.Internal.Cache | 62 | import Network.BitTorrent.Internal.Cache |
66 | import Network.BitTorrent.Internal.Types | 63 | import Network.BitTorrent.Internal.Types |
@@ -95,8 +92,6 @@ data LastScrape = LastScrape | |||
95 | , scrapeSeeders :: Maybe Int | 92 | , scrapeSeeders :: Maybe Int |
96 | } deriving (Show, Eq) | 93 | } deriving (Show, Eq) |
97 | 94 | ||
98 | $(deriveJSON omitRecordPrefix ''LastScrape) | ||
99 | |||
100 | -- | Single tracker session. | 95 | -- | Single tracker session. |
101 | data TrackerSession = TrackerSession | 96 | data TrackerSession = TrackerSession |
102 | { -- | Used to notify 'Stopped' and 'Completed' events. | 97 | { -- | Used to notify 'Stopped' and 'Completed' events. |
@@ -109,13 +104,6 @@ data TrackerSession = TrackerSession | |||
109 | , trackerScrape :: Cached LastScrape | 104 | , trackerScrape :: Cached LastScrape |
110 | } | 105 | } |
111 | 106 | ||
112 | instance ToJSON (TierEntry TrackerSession) where | ||
113 | toJSON (uri, TrackerSession {..}) = object | ||
114 | [ "uri" .= uri | ||
115 | , "peers" .= trackerPeers | ||
116 | , "scrape" .= trackerScrape | ||
117 | ] | ||
118 | |||
119 | -- | Not contacted. | 107 | -- | Not contacted. |
120 | instance Default TrackerSession where | 108 | instance Default TrackerSession where |
121 | def = TrackerSession Nothing def def | 109 | def = TrackerSession Nothing def def |