summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/Message.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/Message.hs b/src/Network/BitTorrent/Tracker/Message.hs
index 212181b9..943c3af5 100644
--- a/src/Network/BitTorrent/Tracker/Message.hs
+++ b/src/Network/BitTorrent/Tracker/Message.hs
@@ -34,6 +34,9 @@ module Network.BitTorrent.Tracker.Message
34 34
35 -- ** Request 35 -- ** Request
36 , AnnounceQueryExt (..) 36 , AnnounceQueryExt (..)
37 , renderAnnounceQueryExt
38 , parseAnnounceQueryExt
39
37 , AnnounceRequest (..) 40 , AnnounceRequest (..)
38 , parseAnnounceRequest 41 , parseAnnounceRequest
39 , renderAnnounceRequest 42 , renderAnnounceRequest
@@ -87,6 +90,7 @@ import Network.Socket
87import Text.Read (readMaybe) 90import Text.Read (readMaybe)
88 91
89import Data.Torrent.InfoHash 92import Data.Torrent.InfoHash
93import Data.Torrent.JSON
90import Data.Torrent.Progress 94import Data.Torrent.Progress
91import Network.BitTorrent.Core 95import Network.BitTorrent.Core
92 96
@@ -104,7 +108,7 @@ data Event = Started
104 -- ^ To be sent when the peer completes a download. 108 -- ^ To be sent when the peer completes a download.
105 deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) 109 deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable)
106 110
107$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''Event) 111$(deriveJSON omitRecordPrefix ''Event)
108 112
109-- | HTTP tracker protocol compatible encoding. 113-- | HTTP tracker protocol compatible encoding.
110instance QueryValueLike Event where 114instance QueryValueLike Event where
@@ -174,7 +178,7 @@ data AnnounceQuery = AnnounceQuery
174 , reqEvent :: Maybe Event 178 , reqEvent :: Maybe Event
175 } deriving (Show, Eq, Typeable) 179 } deriving (Show, Eq, Typeable)
176 180
177$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceQuery) 181$(deriveJSON omitRecordPrefix ''AnnounceQuery)
178 182
179-- | UDP tracker protocol compatible encoding. 183-- | UDP tracker protocol compatible encoding.
180instance Serialize AnnounceQuery where 184instance Serialize AnnounceQuery where
@@ -480,7 +484,7 @@ data AnnounceInfo =
480 , respWarning :: !(Maybe Text) 484 , respWarning :: !(Maybe Text)
481 } deriving (Show, Typeable) 485 } deriving (Show, Typeable)
482 486
483$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceInfo) 487$(deriveJSON omitRecordPrefix ''AnnounceInfo)
484 488
485-- | HTTP tracker protocol compatible encoding. 489-- | HTTP tracker protocol compatible encoding.
486instance BEncode AnnounceInfo where 490instance BEncode AnnounceInfo where
@@ -630,7 +634,7 @@ data ScrapeEntry = ScrapeEntry {
630 , siName :: !(Maybe Text) 634 , siName :: !(Maybe Text)
631 } deriving (Show, Eq, Typeable) 635 } deriving (Show, Eq, Typeable)
632 636
633$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''ScrapeEntry) 637$(deriveJSON omitRecordPrefix ''ScrapeEntry)
634 638
635-- | HTTP tracker protocol compatible encoding. 639-- | HTTP tracker protocol compatible encoding.
636instance BEncode ScrapeEntry where 640instance BEncode ScrapeEntry where