2
0
mirror of synced 2025-02-24 14:48:27 +00:00

68 Commits

Author SHA1 Message Date
Matt Joiner
35064425eb go fmt ./... 2021-09-09 22:51:24 +10:00
YenForYang
99ba75f458 Drop xerrors and reflection dependency
Nothing wrong with missinggo.CopyExact -- but fewer dependencies is better IMO.  Also changed String() to use a consistent receiver name -- not a big deal.
2021-09-04 23:01:37 +10:00
Bora M. Alper
16176b762e
Add linter CI (#542)
* Add linter CI

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make gosec CI ignore SHA1 and upload sarif

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Fix formatting of source files

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make go vet ignore unkeyed composite literals and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make staticcheck ignore unused methods and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Use golangci-lint

Signed-off-by: Bora M. Alper <bora@boramalper.org>
2021-08-16 11:11:31 +10:00
Matt Joiner
c3c982b621 Fixes for wasm 2021-06-23 17:24:50 +10:00
Matt Joiner
15f8e77519 Add explicit metadata extension types 2021-06-21 12:14:06 +10:00
Matt Joiner
9ded7e7e87 Use bytes.Reader instead of bytes.Buffer in a few places 2021-05-05 15:48:57 +10:00
Matt Joiner
f409daa93f PORT message belongs to BEP 5 2021-01-27 17:08:15 +11:00
Matt Joiner
6aaaaaffba Fix unreferenced variable 2021-01-19 10:55:22 +11:00
Matt Joiner
c1d189ed31 Performance improvements to PEX 2020-10-23 08:58:55 +11:00
Matt Joiner
3e9a5a4aec Expose ClientConfig.Extensions
Also run the storage failure test with fast disabled for the seeder. This probably would have tickled some issues in the past, so it seems like a good place to try it out.
2020-04-23 13:03:40 +10:00
Yaroslav Kolomiiets
2b2c480706 PEX: add periodic deltas 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets
93430aa01a PEX: add connection tracking 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets
634edd2875 Share current connections with peers over PEX (anacrolix#341) 2020-04-15 17:24:44 +10:00
Matt Joiner
376ff763fe Apply staticcheck 2020-02-20 11:09:57 +11:00
Matt Joiner
5b0c895e09 Add comments 2019-10-01 18:13:55 +10:00
Matt Joiner
cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner
9224303c1e Update all imports of dht to v2 2019-08-10 18:46:07 +10:00
Matt Joiner
338287486f Always return errors when handshakes or dialing fails
I intend to use xerrors-style error handling for special cases.
2019-07-19 16:15:46 +10:00
Matt Joiner
63d215568a Tidy up function signature 2019-07-19 14:56:29 +10:00
Matt Joiner
e236cbf145 bencode: Fix marshalling of []byte(nil)
Also fixes #293.
2018-11-27 08:57:17 +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
91730696cf Rewrite piece data decoding and relax test 2018-07-14 11:50:43 +10:00
Matt Joiner
01380adac3 peer_protocol: Add a test for receiving overlong piece data
The chunk buffer pool decides the upper bound on chunk data len.
2018-07-14 11:37:56 +10:00
Matt Joiner
cc6441a791 Fix peer_protocol.Message.RequestSpec for Type Piece 2018-07-13 21:33:21 +10:00
Matt Joiner
c001e6e008 Add a test that short pieces are decoded correctly 2018-07-12 09:54:06 +10:00
Matt Joiner
324cc7a281 Comments and trivial tweaks 2018-07-12 09:42:00 +10:00
Matt Joiner
ee985e51cb Add peer_protocol.Integer.Uint32 2018-07-12 09:16:40 +10:00
Matt Joiner
86ca9ffa7e Add peer_protocol.RequestSpec 2018-07-12 09:16:17 +10:00
Matt Joiner
ba8ec1a787 Move back to net.IP for extended handshake message IPs 2018-07-12 00:00:07 +10:00
Matt Joiner
1f6ba94882 Make extended handshake a struct, and move a bunch of extended stuff into peer_protocol 2018-07-10 12:20:36 +10:00
Matt Joiner
50def7a688 Move PEX stuff into peer_protocol 2018-07-10 11:21:24 +10:00
Matt Joiner
a7e338a3f1 More sortimports 2018-07-07 11:40:06 +10:00
Matt Joiner
e0f0617b0b Comments and readability 2018-07-07 11:33:48 +10:00
Matt Joiner
76a3c0891a Expose handshake stuff in peer_protocol 2018-07-07 11:31:29 +10:00
Matt Joiner
54f43419e2 Fix fast extension message type constants
iota isn't worth the trouble
2018-02-05 18:00:47 +11:00
Matt Joiner
93e8d9bfaa Use stringer to generate peer_protocol.MessageType strings 2018-02-05 15:30:35 +11:00
Matt Joiner
20316e5af4 Support AllowedFast and enable fast extension 2018-02-05 00:18:38 +11:00
Matt Joiner
44e44637bf TODOs and comments 2018-02-04 19:14:07 +11:00
Matt Joiner
89b17c4372 Try to print something useful for MessageType panics 2018-02-02 21:52:57 +11:00
Matt Joiner
b610107d8d Break up peer_protocol into several files 2018-02-02 21:29:57 +11:00
Matt Joiner
c9507786f2 Count requested chunk lengths
Have seen some very ridiculous lengths causing data read errors
2018-02-02 16:06:24 +11:00
Matt Joiner
092b139dcf Fix peer_protocol benchmark 2018-01-25 17:43:45 +11:00
Matt Joiner
0b553b296f Add File priorities
Fixes #220.
2018-01-21 22:49:12 +11:00
Matt Joiner
9757f04cf8 Apply megacheck to torrent package 2017-11-07 16:11:59 +11:00
Matt Joiner
3ed8274384 Abstract out making a cancel message 2017-09-18 13:42:42 +10:00
Matt Joiner
260806a6f2 peer_protocol: Improve piece decoding benchmark 2017-09-12 21:32:01 +10:00
Matt Joiner
01fee38709 peer_protocol: Add a benchmark for decoding pieces 2017-09-12 21:12:56 +10:00
Matt Joiner
3eb422afd0 Add peer_protocol.Message.MustMarshalBinary 2017-08-31 14:30:53 +10:00
Matt Joiner
47ef753795 peer_protocol.Decoder.Decode: Avoid allocating another intermediate reader
On my system, BenchmarkConnectionMainReadLoop goes from 596 to 1311 MB/s.
2016-09-25 10:31:43 +10:00
Ye Yin
d3963eedfd Use sync.pool for decode buffer 2016-09-12 17:32:04 +10:00