aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-06-12 07:18:17 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-06-12 07:18:17 +0200
commit4cd179bf51c3f64ef55bd9d118fda623b826958a (patch)
tree9d24cea2859b6ae0c275646fc19e7cda0c2588ab
parent92b93449373418da481369078208bd8630d67c41 (diff)
Announce-list is list of lists
-rw-r--r--bencode/bencode_test.go7
-rw-r--r--meta/torrent.go18
2 files changed, 14 insertions, 11 deletions
diff --git a/bencode/bencode_test.go b/bencode/bencode_test.go
index 2a7678f..76f73d0 100644
--- a/bencode/bencode_test.go
+++ b/bencode/bencode_test.go
@@ -11,8 +11,11 @@ import (
func TestMarshal(t *testing.T) {
v := meta.Torrent{
- Announce: "test",
- AnnounceList: []string{"test1", "test2", "test3"},
+ Announce: "test",
+ AnnounceList: [][]string{
+ []string{"test1", "test2"},
+ []string{"test3"},
+ },
CreationDate: time.Now(),
Info: meta.Info{
Length: 1000,
diff --git a/meta/torrent.go b/meta/torrent.go
index 56a6a97..6a510cb 100644
--- a/meta/torrent.go
+++ b/meta/torrent.go
@@ -19,13 +19,13 @@ type Info struct {
}
type Torrent struct {
- Announce string `bencode:"announce"`
- AnnounceList []string `bencode:"announce-list,optional"`
- Comment string `bencode:"comment,optional"`
- CreatedBy string `bencode:"created by,optional"`
- CreationDate time.Time `bencode:"creation date,optional"`
- HTTPSeeds []string `bencode:"httpseeds,optional"`
- Info Info `bencode:"info"`
- URLList string `bencode:"url-list,optional"`
- InfoHash []byte `bencode:"-"`
+ Announce string `bencode:"announce"`
+ AnnounceList [][]string `bencode:"announce-list,optional"`
+ Comment string `bencode:"comment,optional"`
+ CreatedBy string `bencode:"created by,optional"`
+ CreationDate time.Time `bencode:"creation date,optional"`
+ HTTPSeeds []string `bencode:"httpseeds,optional"`
+ Info Info `bencode:"info"`
+ URLList string `bencode:"url-list,optional"`
+ InfoHash []byte `bencode:"-"`
}