2
0
mirror of synced 2025-02-23 06:08:07 +00:00

2918 Commits

Author SHA1 Message Date
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
Matt Joiner
ad70a761ec Use an iterator to skip through dirty chunks 2021-09-21 10:48:15 +10:00
Matt Joiner
40b0f9ca1e cmd/torrent: Include download stats on interrupt 2021-09-20 21:33:46 +10:00
Matt Joiner
63b3d2d211 Track dirty chunks in a single bitmap on Torrent 2021-09-20 18:52:54 +10:00
Matt Joiner
110b6f3fd3 Fix cancellation for global requesting 2021-09-20 15:24:24 +10:00
Matt Joiner
63f3e8d3de Merge branch 'master' into peer-requesting 2021-09-20 15:10:19 +10:00
Matt Joiner
510877ea43 Reduce the diff to master and add peerRequesting feature const 2021-09-20 15:09:28 +10:00
Matt Joiner
00a7300421 cmd/torrent: Dump download statistics 2021-09-20 14:17:58 +10:00
Matt Joiner
33883c04e4 Filter next requests application for peer state changes 2021-09-20 14:16:55 +10:00
Matt Joiner
a8c7516246 Add NOTES 2021-09-20 12:31:44 +10:00
Matt Joiner
1d2d1a9cde Store peer requests in a bitmap 2021-09-19 15:16:37 +10:00
Matt Joiner
cd49f75cb9 When updating requests, only tickle writer if there are no requests pending
Just a quick attempt to reduce load for now. There'll be a much better way to do this.
2021-09-18 21:01:06 +10:00
Matt Joiner
21358ba458 Do peer requests separately for each peer 2021-09-18 20:34:14 +10:00
Matt Joiner
d90c41c534 Add choking/allowed fast checks to Peer.shouldRequest 2021-09-18 19:00:21 +10:00
Matt Joiner
cfb23e271f Export request_strategy.GetRequestablePieces 2021-09-18 18:57:50 +10:00
Matt Joiner
72eb52bb8e goimports doing its thing 2021-09-18 18:54:54 +10:00
Matt Joiner
900f36f1a9 Add some tests verifying request map ordering 2021-09-18 13:50:55 +10:00
Matt Joiner
7d8d5b0cfc Update anacrolix/args for bool Flag fix 2021-09-18 13:23:36 +10:00
Matt Joiner
c6fb0535d4 requesting: Remove some obsoleted condition checks
These shouldn't be necessary since peers were pruned for the ability to allocate chunks to the current piece.
2021-09-18 12:53:22 +10:00
Matt Joiner
dd52a1440f request_strategy.Peer.canRequestPiece performance: Reorder conditions 2021-09-18 12:53:22 +10:00
YenForYang
7b19e81fc6
bencode: get type of big.Int without creating instance (#651)
Nope, it doesn't really matter. But anyway, see c084706c22/cryptobyte/asn1.go (L267)
2021-09-18 12:44:47 +10:00
YenForYang
ed3b3ee5ca
bencode: simplify getting marshalerType and unmarshalerType (#652) 2021-09-18 12:43:53 +10:00
YenForYang
d43769dc15
bencode: Simplify (*Decoder).parseListInterface() (#656)
Preserve as much type as possible (it'll be converted to an `interface{}` anyway, but we can return `[]interface{}` instead of `{}interface` here).
2021-09-18 12:42:20 +10:00
YenForYang
f3a9ea5aa9
Prevent allocation when checking interface (#649) 2021-09-18 12:36:25 +10:00