]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add MarshalBencode to the torrent_info_ex, will be used by the Builder.
authornsf <no.smile.face@gmail.com>
Thu, 5 Jul 2012 16:44:27 +0000 (22:44 +0600)
committernsf <no.smile.face@gmail.com>
Thu, 5 Jul 2012 16:44:27 +0000 (22:44 +0600)
torrent/file.go

index 87beef5b355da033ad9e61fefc65c4d1474d8017..13c73d17fc788de68df8a7bfd0e7519a67f4bc9c 100644 (file)
@@ -160,6 +160,10 @@ func (this *torrent_info_ex) UnmarshalBencode(data []byte) error {
        return bencode.Unmarshal(data, &this.torrent_info)
 }
 
+func (this *torrent_info_ex) MarshalBencode() ([]byte, error) {
+       return bencode.Marshal(&this.torrent_info)
+}
+
 type torrent_data struct {
        Info         torrent_info_ex `bencode:"info"`
        Announce     string          `bencode:"announce"`