Commit Graph

76 Commits

Author SHA1 Message Date
Matt Joiner a0d0c64e4f metainfo: Fix test
[]byte(nil) now correctly bencodes to a string
2018-11-27 11:05:32 +11:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00
Matt Joiner f5bd377941 Change pieceIndex to peer_protocol.Integer 2018-07-12 09:15:15 +10:00
Matt Joiner d7225aed03 Fix #247 2018-04-13 17:07:19 +10:00
Matt Joiner 1f3eace72f bencode: Add ignore_unmarshal_type_error tag 2018-01-27 14:31:46 +11:00
Matt Joiner 0e32592f78 bencode: Give more descriptive errors when failing to parse dicts 2018-01-25 21:46:50 +11:00
Matt Joiner a0172f7c6e Update error message in metainfo.Info.writeFiles
I think it was ripped out of some other code a long time ago.
2017-12-29 12:18:55 +11:00
Matt Joiner 5ac3e9ae54 Introduce metainfo.HashSize
This will be useful when BitTorrent 2 is implemented, and helps with creating arbitrary Info.Pieces
2017-12-29 12:17:58 +11:00
Matt Joiner 8195e8df7b Improve some doc comments 2017-12-29 12:16:05 +11:00
Matt Joiner da9cbc7cf0 metainfo: Omit empty Metainfo.InfoBytes 2017-11-08 19:57:05 +11:00
Matt Joiner 17ea4f7fdd Performance optimizations to calculating bytes left in Torrent
Was generating significant overhead in cmd/torrent
2017-09-23 15:28:13 +10:00
Matt Joiner cc17c8a54c metainfo URL list can be a string or list 2017-06-16 17:07:30 +10:00
Matt Joiner 6ca3275752 metainfo: Improve MetaInfo.AnnounceList handling 2017-02-15 20:05:28 +11:00
Matt Joiner a959bdd0f8 Revert "Quick fix for missing MetaInfo.Announce everywhere with trackers"
This reverts commit b7a8d08bbf.
2017-02-15 18:40:30 +11:00
Matt Joiner b7a8d08bbf Quick fix for missing MetaInfo.Announce everywhere with trackers 2017-02-13 22:28:42 +11:00
Matt Joiner 79d800fe92 Trivial logging, comment, Stringer changes 2017-02-02 16:53:19 +11:00
Matt Joiner c66c4d1744 Change type of metainfo.Info.URLList 2017-01-18 12:10:13 +11:00
Matt Joiner 902e40dd67 TODO 2017-01-18 12:09:51 +11:00
Matt Joiner 03227bf461 metainfo: FileInfo.Offset failed with single-file torrents 2017-01-04 18:09:17 +11:00
Matt Joiner 51bae0a3c8 metainfo: Add helper methods to FileInfo 2017-01-04 17:15:11 +11:00
Matt Joiner 65295eb513 Panic if NewHashFromHex gets a bad string 2017-01-01 10:08:45 +11:00
Barsanuphe 86c5b20e3f Added optional source flag to torrent files (#137) 2016-12-09 13:16:56 +11:00
Matt Joiner 04dedcef9f metainfo: Remove unused import 2016-11-08 21:09:04 +11:00
Vincent 7d327905fe feat: remove print BuildFromFilePath
removes the print of (path, err) in function BuildFromFilePath
2016-11-05 09:56:31 +11:00
Matt Joiner b304baad1b Add error return value to metainfo.MetaInfo.UnmarshalInfo
Too many problems caused by bad info bytes in downstream projects.
2016-09-20 12:32:15 +10:00
Matt Joiner 30da5211dd Comment on metainfo.PieceKey 2016-09-16 11:18:36 +10:00
Ben Gadbois e34891f42b Comment typo (#110) 2016-09-07 09:43:29 +10:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner 4143b7470d Begin exposing all the magic that Client.WriteStatus has so people can parse Client state their own way
It wasn't possible to move Client.WriteStatus to an external package to verify it doesn't depend on same-package access to data because then it can't be used in the tests, and it's extremely useful there. So I've settled for not locking the Client, and trying to use all the public methods. It's a work in progress.
2016-07-30 00:37:52 +10:00
Ye Yin 6a2137f2b6 Add Announce when AnnounceList is nil 2016-07-22 15:16:11 +08:00
Matt Joiner a4e140b939 New slices package 2016-07-12 16:40:14 +10:00
Matt Joiner 5475555252 metainfo: Move method in wrong file 2016-07-09 00:12:32 +10:00
Matt Joiner 2490c96f2f metainfo.Info.BuildFromFilePath: Ensure stable file ordering
Spotted by @axet, with precedent in Transmission.
2016-07-07 19:40:26 +10:00
Matt Joiner 364f617ade Add metainfo.NewHashFromHex 2016-06-21 02:35:53 +10:00
Matt Joiner cee200a5a2 Add piece completion storage
Toward fixing https://github.com/anacrolix/torrent/issues/50.
2016-06-20 17:51:05 +10:00
Matt Joiner 2d160b0419 metainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in marshalling
Fixes #80.
2016-05-05 22:40:38 +10:00
Matt Joiner 533f01147d metainfo: Add HashBytes 2016-05-03 21:34:20 +10:00
Matt Joiner e0451b0728 metainfo: Improve doc 2016-05-03 21:34:11 +10:00
Matt Joiner bed302faa8 metainfo.Info.BuildFromFilePath contained unnecessary log, and didn't handle error correctly 2016-05-03 20:25:16 +10:00
Matt Joiner bdf36c09cf Doc metainfo.Info.BuildFromFilePath 2016-05-03 12:51:03 +10:00
Matt Joiner 7044161faa Add metainfo.Hash.FromHexString 2016-05-02 11:21:03 +10:00
Matt Joiner 5882a3b32e Remove metainfo.Builder, and issue #35 test for it
Builder is poorly designed, and issue #35 is poorly written. I don't want to support either of them.
2016-04-30 12:00:12 +10:00
Matt Joiner 0cd8b4fd3b Allow encoding private=0 in metainfo, which fixes test for not using InfoEx.Bytes when marshalling as a shortcut 2016-04-30 11:59:10 +10:00
Matt Joiner 28c9ec2bd1 Some changes to metainfo.InfoEx and testutil 2016-04-30 11:07:29 +10:00
Seth Hoenig 9f4bf70e17 refactor struct identifiers to follow conventional go names 2016-04-18 23:11:11 -05:00
Matt Joiner f83771b660 Apply ineffassign linter 2016-04-04 15:39:26 +10:00
Matt Joiner fa511154e4 Move Magnet and friends into metainfo package 2016-04-04 13:48:39 +10:00
Matt Joiner b80bb6393a Use metainfo.Hash for piece and info hashes 2016-04-04 13:01:31 +10:00
Matt Joiner 0a3a5d6ae0 Finish fixing tests 2016-03-29 00:24:00 +11:00
Matt Joiner 775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00