summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-21 00:48:19 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-21 00:48:19 +0400
commit9101056298bbbd891b6134c45b63146c2b2125e2 (patch)
tree8bace6ba2831f6e1448bae50dba8bf0b0dccf12a /src/Network/BitTorrent/Tracker
parent8fe68502f23cd737cfd198ce63ae8522c8e11a7f (diff)
+ Add JSON instances for Tracker info.
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/Protocol.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Tracker/Protocol.hs b/src/Network/BitTorrent/Tracker/Protocol.hs
index 23bbe498..5ee61185 100644
--- a/src/Network/BitTorrent/Tracker/Protocol.hs
+++ b/src/Network/BitTorrent/Tracker/Protocol.hs
@@ -71,6 +71,7 @@ data Event = Started
71 -- ^ To be sent when the peer completes a download. 71 -- ^ To be sent when the peer completes a download.
72 deriving (Show, Read, Eq, Ord, Enum, Bounded) 72 deriving (Show, Read, Eq, Ord, Enum, Bounded)
73 73
74$(deriveJSON (L.map toLower . L.dropWhile isLower) ''Event)
74 75
75-- | A tracker request is HTTP GET request; used to include metrics 76-- | A tracker request is HTTP GET request; used to include metrics
76-- from clients that help the tracker keep overall statistics about 77-- from clients that help the tracker keep overall statistics about
@@ -111,6 +112,7 @@ data AnnounceQuery = AnnounceQuery {
111 -- ^ If not specified, the request is regular periodic request. 112 -- ^ If not specified, the request is regular periodic request.
112 } deriving Show 113 } deriving Show
113 114
115$(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceQuery)
114 116
115-- | The tracker response includes a peer list that helps the client 117-- | The tracker response includes a peer list that helps the client
116-- participate in the torrent. The most important is 'respPeer' list 118-- participate in the torrent. The most important is 'respPeer' list
@@ -141,6 +143,7 @@ data AnnounceInfo =
141 -- ^ Peers that must be contacted. 143 -- ^ Peers that must be contacted.
142 } deriving Show 144 } deriving Show
143 145
146$(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceInfo)
144 147
145-- | Ports typically reserved for bittorrent P2P listener. 148-- | Ports typically reserved for bittorrent P2P listener.
146defaultPorts :: [PortNumber] 149defaultPorts :: [PortNumber]