diff options
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Torrent.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index 05d3c86c..db7f38eb 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -94,7 +94,7 @@ import Data.Torrent.InfoHash as IH | |||
94 | import Data.Torrent.JSON | 94 | import Data.Torrent.JSON |
95 | import Data.Torrent.Layout | 95 | import Data.Torrent.Layout |
96 | import Data.Torrent.Piece | 96 | import Data.Torrent.Piece |
97 | 97 | import Network.BitTorrent.Core.Node | |
98 | 98 | ||
99 | {----------------------------------------------------------------------- | 99 | {----------------------------------------------------------------------- |
100 | -- Info dictionary | 100 | -- Info dictionary |
@@ -215,6 +215,12 @@ data Torrent = Torrent | |||
215 | , tInfoDict :: !InfoDict | 215 | , tInfoDict :: !InfoDict |
216 | -- ^ Info about each content file. | 216 | -- ^ Info about each content file. |
217 | 217 | ||
218 | , tNodes :: Maybe [NodeAddr ByteString] | ||
219 | -- ^ This key should be set to the /K closest/ nodes in the | ||
220 | -- torrent generating client's routing table. Alternatively, the | ||
221 | -- key could be set to a known good 'Network.BitTorrent.Core.Node' | ||
222 | -- such as one operated by the person generating the torrent. | ||
223 | |||
218 | , tPublisher :: !(Maybe URI) | 224 | , tPublisher :: !(Maybe URI) |
219 | -- ^ Containing the RSA public key of the publisher of the | 225 | -- ^ Containing the RSA public key of the publisher of the |
220 | -- torrent. Private counterpart of this key that has the | 226 | -- torrent. Private counterpart of this key that has the |
@@ -285,6 +291,7 @@ instance BEncode Torrent where | |||
285 | .: "creation date" .=? tCreationDate | 291 | .: "creation date" .=? tCreationDate |
286 | .: "encoding" .=? tEncoding | 292 | .: "encoding" .=? tEncoding |
287 | .: "info" .=! tInfoDict | 293 | .: "info" .=! tInfoDict |
294 | .: "nodes" .=? tNodes | ||
288 | .: "publisher" .=? tPublisher | 295 | .: "publisher" .=? tPublisher |
289 | .: "publisher-url" .=? tPublisherURL | 296 | .: "publisher-url" .=? tPublisherURL |
290 | .: "signature" .=? tSignature | 297 | .: "signature" .=? tSignature |
@@ -298,6 +305,7 @@ instance BEncode Torrent where | |||
298 | <*>? "creation date" | 305 | <*>? "creation date" |
299 | <*>? "encoding" | 306 | <*>? "encoding" |
300 | <*>! "info" | 307 | <*>! "info" |
308 | <*>? "nodes" | ||
301 | <*>? "publisher" | 309 | <*>? "publisher" |
302 | <*>? "publisher-url" | 310 | <*>? "publisher-url" |
303 | <*>? "signature" | 311 | <*>? "signature" |
@@ -336,7 +344,7 @@ instance Pretty Torrent where | |||
336 | nullTorrent :: URI -> InfoDict -> Torrent | 344 | nullTorrent :: URI -> InfoDict -> Torrent |
337 | nullTorrent ann info = Torrent | 345 | nullTorrent ann info = Torrent |
338 | ann Nothing Nothing Nothing Nothing Nothing | 346 | ann Nothing Nothing Nothing Nothing Nothing |
339 | info Nothing Nothing Nothing | 347 | info Nothing Nothing Nothing Nothing |
340 | 348 | ||
341 | -- | Mime type of torrent files. | 349 | -- | Mime type of torrent files. |
342 | typeTorrent :: BS.ByteString | 350 | typeTorrent :: BS.ByteString |