Commit Graph

33 Commits

Author SHA1 Message Date
Matt Joiner 1b66994c0a Add some fuzzing in peer_protocol 2021-09-30 09:01:10 +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 15f8e77519 Add explicit metadata extension types 2021-06-21 12:14:06 +10:00
Matt Joiner f409daa93f PORT message belongs to BEP 5 2021-01-27 17:08:15 +11:00
Matt Joiner 324cc7a281 Comments and trivial tweaks 2018-07-12 09:42:00 +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 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 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 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
Matt Joiner 380dc7a2b4 Add peer_protocol.Integer.Int() 2016-02-21 17:25:26 +11:00
Matt Joiner e85b7e228b Add support for Fast Extension 2015-03-12 20:06:23 +11:00
Matt Joiner c9bc892789 Implement the DHT Port message 2014-08-25 22:12:16 +10:00
Matt Joiner a2fabedfa2 Clarify EOF in message decoding 2014-08-22 17:39:18 +10:00
Matt Joiner a258b9ab21 Squash some more debug messages, fix some other error handling 2014-07-17 16:01:48 +10:00
Matt Joiner c96293a111 Can now download from magnet links 2014-06-28 19:38:31 +10:00
Matt Joiner 49e71f9654 Begin adding magnet and ut_metadata support 2014-06-27 00:57:07 +10:00
Matt Joiner ef69e82765 Keepalives weren't marshalled correctly 2014-05-29 01:22:51 +10:00
Matt Joiner dd30d144ae Avoid rebuffering in peer_protocol.Decode 2014-05-23 00:36:47 +10:00
Matt Joiner 8cb39521f2 Fix short read and report unexpected EOFs decoding peer protocol 2014-03-21 00:42:40 +11:00
Matt Joiner 2e81f914e7 Add a end-to-end test for torrentfs
Basic unchoking and uploading.
Accept incoming connections.
Break out torrentfs lib.
Fix and implement some protocol stuff.
2014-03-18 01:44:22 +11:00
Matt Joiner beb599698f Decoding of Piece messages, and checking entire message is consumed 2013-10-02 17:57:19 +10:00
Matt Joiner 28531a4fcc Fix request/chunk confusion, missing outgoing message prefix, protocol tests; improve request triggering 2013-10-01 18:43:18 +10:00
Matt Joiner 081a6805c5 Implementing bitfields and connection message handling 2013-09-30 21:51:08 +10:00
Matt Joiner abf5c92488 Implement peer connection writer, optimizer and handshake 2013-09-29 16:45:17 +10:00
Matt Joiner 7870d20573 Begin implementing the adding of peers, and initiating of connections 2013-09-29 08:11:24 +10:00