Commit Graph

2941 Commits

Author SHA1 Message Date
Matt Joiner 16c571b58b Add pprof labels for request updates and remove Client-wide requester 2021-10-19 14:08:13 +11:00
Matt Joiner 30b99e7102 Remove peer piece inclination and piece request order
These are vestigial data structures used with old request strategy implementations.
2021-10-19 14:08:13 +11:00
Matt Joiner 0f53cbf07e Change peer requesting to spread requests out evenly 2021-10-19 14:08:13 +11:00
Matt Joiner 3ef8cfba27 Log handshook conn run errors with level warning
(cherry picked from commit 7ca7890e9f30307a1f4942e6d987791a142c3cb3)
2021-10-19 14:07:48 +11:00
Matt Joiner 58cc0f3d87 Ending a conn because we don't like its ID is not an error
(cherry picked from commit 2a5ba846cef9b4e035b3b88698f3e7f7d9d79251)
2021-10-19 14:07:40 +11:00
Matt Joiner c18e0abe52 Fix incomplete Integer.Read
Possibly on read buffer boundaries, this would have caused errant io.ErrUnexpectedEOF.

(cherry picked from commit 22569449dad48e1c5cdeac171625585f8ca976c9)
2021-10-19 14:07:23 +11:00
Matt Joiner d19079e698 Only allow chunk size to be set for new Torrents
(cherry picked from commit 09e73e9fce139cd78da48c442e8610501b6fd26b)
2021-10-19 14:04:07 +11:00
Matt Joiner 6f196c8d33 Update piece priority after processing piece hash result
Seems to avoid some silly performance issues in triggering request updates due to a piece still pending while being marked.
2021-10-19 14:03:03 +11:00
Matt Joiner 329578520a Pieces being marked should have priority none
Also reorder the checks a bit to favour the cheaper ones.
2021-10-19 14:00:52 +11:00
Simon Kirsten 637045c19a
Add DisableInitialPieceCheck option (#677) 2021-10-11 11:33:40 +11:00
Matt Joiner 1b78a9bcc6 Update requests on unchoke 2021-10-07 17:20:04 +11:00
Matt Joiner 4d496bf756 cmd/torrent: Ensure envpprof.Stop runs before exit 2021-10-07 17:00:39 +11:00
Matt Joiner 15a2d3fb23 go mod tidy
Fixes broken go doc: https://github.com/golang/go/issues/36811#issuecomment-937401816
2021-10-07 13:56:45 +11:00
Matt Joiner 72a06d88fc Add TorrentStats.PiecesComplete
Fixes https://github.com/anacrolix/torrent/issues/352.
2021-10-07 13:50:13 +11:00
Matt Joiner 62c83a5b9c Add to tests for Torrent.Complete 2021-10-07 13:38:29 +11:00
Matt Joiner f47a12bd32 Return errors from Client.Close 2021-10-07 13:31:08 +11:00
Matt Joiner 28e9064288 Fix comment that seems to mess with GoLand's package structure 2021-10-07 12:09:52 +11:00
Matt Joiner c9c137d8f2 Add a flag for Complete 2021-10-07 12:09:20 +11:00
Matt Joiner 81c47d5705 Upgrade Torrent.GotInfo 2021-10-07 11:50:30 +11:00
Matt Joiner 9720fd576d Update chansync 2021-10-07 11:45:09 +11:00
Matt Joiner 118391c3bf Apply some lints from GoLand 2021-10-07 09:12:17 +11:00
Matt Joiner 11ae25660a Remove old-style build tags 2021-10-07 09:12:17 +11:00
Matt Joiner eab111dd84 Switch Peer.PieceAllowedFast and several request strategy inputs to raw roaring.Bitmaps
This is in preparation to support encoding request strategy run inputs for benchmarking.
2021-10-05 20:06:23 +11:00
Matt Joiner fd8995dcfd go fmt ./... 2021-10-05 17:48:52 +11:00
Matt Joiner da1221dd50 Change Peer._peerPieces to use raw roaring Bitmap type
The wrapper type was from when roaring didn't support zero-alloc initialization.
2021-10-05 17:48:34 +11:00
Matt Joiner 719d5c6400 Wrap error with %w in mainReadLoop 2021-09-30 12:01:56 +10:00
Matt Joiner 846167c63e Fix mainReadLoop benchmark 2021-09-30 12:01:34 +10:00
Matt Joiner 4ed855070f Fix scheduling overhead in decoding benchmark 2021-09-30 11:52:50 +10:00
Matt Joiner 702cf3c8f7 Combine peer protocol fuzz targets into one file 2021-09-30 11:19:50 +10:00
Matt Joiner 2027028539 More optimizations in peer protocol message decoding 2021-09-30 11:05:01 +10:00
Matt Joiner 73696fd215 peer_protocol: Use faster form for Integer.{UnmarshalBinary,Read} 2021-09-30 10:24:03 +10:00
Matt Joiner 60a622ff4b Remove an allocation reading message length 2021-09-30 09:59:18 +10:00
Matt Joiner 709ee70b0c Try to avoid allocating buffer 2021-09-30 09:45:50 +10:00
Matt Joiner b69e6dff01 Improvements to decoder fuzzing 2021-09-30 09:42:54 +10:00
Matt Joiner 1b66994c0a Add some fuzzing in peer_protocol 2021-09-30 09:01:10 +10:00
Matt Joiner 6156aebf71 Limit decoded bencode string lengths to 32 bits
Found in fuzzing
2021-09-29 16:56:01 +10:00
Matt Joiner fcf65ee56a Add some fuzzing seeds 2021-09-29 12:12:16 +10:00
Matt Joiner 10ecd4390a Fix parsing of strings that don't fit in memory 2021-09-29 12:11:58 +10:00
Matt Joiner 03f8ec7090 Fix fuzz comparison of big.Int 2021-09-29 12:11:17 +10:00
Matt Joiner 2daad6e564 Update fuzz to use new standard library support 2021-09-29 11:51:03 +10:00
Matt Joiner a9aec0bb79 Simplify bencode.Decoder.parseStringInterface 2021-09-29 09:50:01 +10:00
YenForYang 37455d3c6b
bencode: optimize `(*Decoder).parseStringInterface()` (#659) 2021-09-29 09:30:35 +10:00
YenForYang 86fe6cc872
Inlineable `(*Torrent).BytesMissing()` (#633)
Honestly a name like `BytesLeft` would have been more suitable, but it's too late for that I guess.
2021-09-27 12:43:09 +10:00
YenForYang 644a746b6b
Inlineable `addrIndex` (#673) 2021-09-27 12:41:20 +10:00
YenForYang 76f593e36b
Eliminate `expect` dependency (#667) 2021-09-24 00:10:30 +10:00
Matt Joiner a330b23e9e Default to peer requesting disabled
There are some flaws that need to be fixed up before it might be considered the default.
2021-09-21 16:07:08 +10:00
Matt Joiner ebd523e39c cmd/torrent: Don't make --stats default to --debug's value 2021-09-21 13:06:06 +10:00
Matt Joiner b6182bdce9 Remove unused function 2021-09-21 13:05:16 +10:00
Matt Joiner 4ca47eb358 Add ClientConfig.AlwaysWantConns 2021-09-21 13:04:51 +10:00
Matt Joiner c1744e37be cmd/torrent: Refactor and set progress interval to 3s 2021-09-21 10:48:16 +10:00