Commit Graph

72 Commits

Author SHA1 Message Date
Matt Joiner 1bae62fd22 Dynamic outbound max requests
This might be one solution to https://github.com/anacrolix/torrent/issues/698.
2021-12-24 08:55:57 +11:00
Matt Joiner 506ff8d037 Use relative availabilities to determine piece request order
Most overhead comes from peers that connect that have everything, and we just increment every single piece's availability. There may be some unresolved determinism with torrents that share the same ordering.
2021-12-23 14:00:00 +11:00
Matt Joiner bdb33ef9f7 gofumpt -extra 2021-12-23 14:00:00 +11:00
Matt Joiner 175b826e73 Rework Reader waiting 2021-09-04 23:07:32 +10:00
Matt Joiner 0d4e566fc0 Extract request strategy stuff into a separate module 2021-06-07 13:01:39 +10:00
Matt Joiner 09823b9e36 Rework to improve work stealing and try to thread peers through all request pieces 2021-06-07 13:01:39 +10:00
Matt Joiner 456a2f7c5d Expose more callbacks and Request and ChunkSpec 2021-01-28 14:23:22 +11:00
Matt Joiner 27108bd2f7 Export Peer 2021-01-25 15:49:48 +11:00
Matt Joiner 563a09cc47 connLessTrusted takes peer instead of PeerConn 2020-06-01 00:03:51 +10:00
Matt Joiner dff436f102 Rename connection->PeerConn and fix exports 2020-02-21 11:07:50 +11:00
Matt Joiner d24922dc09 Add support for non-IP-based networks
Includes a test with unix sockets. Exposes AddDialer, AddListener, and reworks Peer.
2020-02-20 16:47:37 +11:00
Matt Joiner 5f1d937b62 Add connection trust flag, and more tests with small caches
Thanks to observations and feedback from @ccampbell.
2019-12-18 13:52:00 +11:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner 1dc406c81c Move IpPort to missinggo 2018-11-16 10:35:30 +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 6d6197b0a1 Switch pieceIndex back to an int
I suspect that interface conversions using packet iter are causing a lot of allocation. Either way, with the casting this adds, we should be able to change pieceIndex's type alias now with minimal code change.
2018-07-17 21:28:01 +10:00
Matt Joiner f5bd377941 Change pieceIndex to peer_protocol.Integer 2018-07-12 09:15:15 +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 fad06c7ddf sortimports 2018-07-07 11:36:58 +10:00
Matt Joiner e1d6fc2341 Add torrent.InfoHash type alias 2018-07-07 11:32:52 +10:00
Matt Joiner 7dd532d46f Check that chunks we request aren't being hashed or queued for hash 2018-06-26 13:04:15 +10:00
Matt Joiner ab48d4731c Include rate limiting and stats in BenchmarkConnectionMainReadLoop 2018-06-11 12:20:51 +10:00
Matt Joiner 319e57d1c6 Rework conns to/and allow multiple DHT servers
This will help with #229, and IPv6 support.
2018-04-12 11:41:07 +10:00
Matt Joiner 646622b8f1 Move clamp and max, and add min to misc.go 2018-02-16 12:14:15 +11:00
Matt Joiner d6f6359799 Remove errant log message 2018-02-14 01:14:05 +11:00
Matt Joiner 39bde7237e Try to count IPv6 connections 2018-02-13 00:48:21 +11:00
Matt Joiner 738a75bc1c Prepare to support sending reject messages 2018-02-03 13:35:09 +11:00
Matt Joiner ffe778392c request can be made from Reject and Cancel messages too 2018-02-02 23:56:06 +11:00
Matt Joiner 7a95714df2 Factor out connection.onReadRequest 2018-02-02 19:19:14 +11:00
Matt Joiner 7eb62eec0d Move some code around 2017-11-08 15:00:18 +11:00
Matt Joiner fdf75d59c8 Kick only the worst connection when a piece fails a check 2016-11-23 12:59:23 +11:00
Matt Joiner 4d10fd3496 Fix issue #112 2016-09-12 16:54:43 +10:00
Matt Joiner da4d40ed7e Merge all our global consts and vars into global.go
For easier referral to other parties.
2016-04-14 17:19:07 +10:00
Matt Joiner fda1cc3f7b Remove more deadcode 2016-04-04 15:23:05 +10:00
Matt Joiner 1566e2afdc Remove deadcode 2016-04-04 15:18:51 +10:00
Matt Joiner b80bb6393a Use metainfo.Hash for piece and info hashes 2016-04-04 13:01:31 +10:00
Matt Joiner 775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner bb04cb8843 Tidy up bytesLeft calculations
This should fix a bug where completion is shown as negative in WriteStatus
2016-03-22 13:11:36 +11:00
Matt Joiner 06ebc4c37e Explicitly import Torrent.InfoHash 2015-08-02 03:55:48 +10:00
Matt Joiner c018c660f0 Allow chunk size to be specified per torrent 2015-07-15 15:31:18 +10:00
Matt Joiner dd34efad57 Comments and update version strings 2015-06-28 16:40:46 +10:00
Matt Joiner af127dfd0f Add some metainfo validation 2015-06-03 00:17:58 +10:00
Matt Joiner ade6087b2f Move torrentOffsetRequest and torrentRequestOffset, fixing a bug in former, and test it 2015-04-08 02:20:01 +10:00
Matt Joiner 533c034747 import pp peer_protocol in misc.go 2015-04-08 02:17:15 +10:00
Matt Joiner 6c48d59adb Move piece into its own file 2015-04-08 02:14:35 +10:00
Matt Joiner 67f90ed886 More public interface tidying 2015-03-20 23:52:53 +11:00
Matt Joiner 842a32ae0c Rewrite import paths for migration from Bitbucket 2015-03-20 16:37:44 +11:00
Matt Joiner e6fbde0dc6 Rework piece completion 2015-03-11 02:41:21 +11:00
Matt Joiner ad6ac3f2cd More cleaning of public interface 2015-03-08 17:28:14 +11:00
Matt Joiner a2d69b4931 Make blob data stateful 2015-02-27 12:45:55 +11:00