Add MarshalBencode to the torrent_info_ex, will be used by the Builder.

This commit is contained in:
nsf 2012-07-05 22:44:27 +06:00
parent ae6df86341
commit b1a6e3eeef
1 changed files with 4 additions and 0 deletions

View 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"`