From: nsf Date: Thu, 5 Jul 2012 16:44:27 +0000 (+0600) Subject: Add MarshalBencode to the torrent_info_ex, will be used by the Builder. X-Git-Tag: v1.0.0~1199^2~23 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b1a6e3eeefad8ac8cf33832cacd358af271f1e84;p=btrtrc.git Add MarshalBencode to the torrent_info_ex, will be used by the Builder. --- diff --git a/torrent/file.go b/torrent/file.go index 87beef5b..13c73d17 100644 --- a/torrent/file.go +++ b/torrent/file.go @@ -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"`