From b1a6e3eeefad8ac8cf33832cacd358af271f1e84 Mon Sep 17 00:00:00 2001 From: nsf Date: Thu, 5 Jul 2012 22:44:27 +0600 Subject: [PATCH] Add MarshalBencode to the torrent_info_ex, will be used by the Builder. --- torrent/file.go | 4 ++++ 1 file changed, 4 insertions(+) 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"`