Commit Graph

600 Commits

Author SHA1 Message Date
Matt Joiner 32d89830ed
Use generic pubsub 2022-03-17 14:55:55 +11:00
Matt Joiner 39af2fe8f2
Merge branch 'http-proxying' 2022-03-15 12:41:22 +11:00
Matt Joiner a319506dda
Expose Torrent.AddWebSeeds 2022-03-11 14:23:05 +11:00
Matt Joiner ec2b1b2073
Support banning webseeds 2022-03-11 14:05:31 +11:00
Matt Joiner d06f990b81 Use HTTP proxy config for torrent sources 2022-02-25 19:59:16 +11:00
Matt Joiner a324fbfee3 Make use of the lazylog branch of anacrolix/log
This avoids significant allocations and overhead.
2022-01-31 17:22:36 +11:00
Matt Joiner 68e47c4bea Include peer net.Conn endpoint addresses in webrtc conn string 2022-01-27 15:24:48 +11:00
Matt Joiner c47e6b1f60 Use webrtc selected ICE candidate for peer addresses 2022-01-22 18:35:06 +11:00
Matt Joiner 83a8284d6a Add tests for preferred network direction 2022-01-12 15:01:33 +11:00
Matt Joiner f7494791d0 Reduce some logging 2021-12-27 22:06:52 +11:00
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 9d07f3ea77 Replace piece availability with frequencies in Torrent status 2021-12-23 17:01:39 +11:00
Matt Joiner cc0d223a65 Apply download rate limiter to webseeds 2021-12-23 14:00:00 +11:00
Matt Joiner 80aec73cb5 Make Torrent.cancelRequestsForPiece more efficient 2021-12-23 14:00:00 +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 74c70d852a Add TestHaveAllThenBitfield
The result of a misguided attempt to reduce piece peer availability increment and decrement overhead for have all/full-bitfield and conn closes.
2021-12-23 14:00:00 +11:00
Matt Joiner ffb98097fa Fix BenchmarkUpdatePiecePriorities 2021-12-16 14:00:19 +11:00
Matt Joiner 98f188dcbe Update requests after deleting all in some corner cases
Choked by non-fast PeerConn, deleted PeerConn. They're not exactly guarded as strictly as they could be, so there's plenty of room for performance improvements here.
2021-12-13 12:09:12 +11:00
Matt Joiner a671c06b94 Update peer requests if not interested when piece priorities change
This should fix a starvation issue where we don't signal interest to a peer that has us choked.
2021-12-13 11:55:47 +11:00
Matt Joiner 04beb8937f More consistent cancellation management 2021-12-12 18:35:02 +11:00
Matt Joiner 1bc84e316f Don't group Torrent piece request orders without a storage capacity together 2021-12-12 18:35:02 +11:00
Matt Joiner ddf41fc2f1 Add Torrent-level request cancel for consistency 2021-12-12 18:35:01 +11:00
Matt Joiner 117ae28b38 Try request stealing 2021-12-12 18:35:01 +11:00
Matt Joiner 99a64bcf63 Wait between duplicate requests 2021-12-12 18:35:01 +11:00
Matt Joiner 94bb5d40ba Implement piece request ordering with retained state 2021-12-12 18:35:01 +11:00
Matt Joiner ba592028e5 Filter update requests on piece priority change by peer choking and allowed fast 2021-12-12 15:01:50 +11:00
Matt Joiner a2c50ea2bd Handle 503 returns from webseed peer endpoints 2021-12-06 15:24:28 +11:00
Matt Joiner 0f495ce97d Optimize the use of worstConnSlice again 2021-11-29 10:07:48 +11:00
Matt Joiner 4f3db19ca3 Optimize Torrent.haveAnyPieces 2021-11-29 00:44:24 +11:00
Matt Joiner 97e1e2469b Announce to DHT if we want conns, not just peers 2021-11-28 22:46:45 +11:00
Matt Joiner b196fe7765 Wanting peers is a subset of wanting conns 2021-11-28 22:40:55 +11:00
Matt Joiner f621f0f5a8 Don't want conns for seeding unless we have a piece 2021-11-28 22:40:53 +11:00
Matt Joiner 560b463983 Comment out pending requests tests and asserts
These need to be updated. BSI for pending requests removes an enormous amount of memory use for very large torrents.
2021-11-25 22:59:20 +11:00
Matt Joiner 0f81e0011f Avoid calling net.Conn methods with the Client mutex locked
The utp firewall callback might want to use it. I can't think of a better way to determine with an incoming connection request should be blocked.
2021-11-17 14:00:50 +11:00
Matt Joiner a90ae5aed4 Pass HTTP Proxy config into webseeding HTTP client 2021-11-12 14:16:14 +11:00
Matt Joiner dea0e41e29 Boost webseed max requests 2021-11-12 13:51:58 +11:00
Matt Joiner 2fd928b918 Don't use non-directory webseed URLs for multi-file torrents 2021-11-12 12:37:40 +11:00
Matt Joiner c6ee03f449 gofumpt 2021-11-08 14:47:01 +11:00
Matt Joiner 8d193edb7e Remove unused Torrent.numActivePeers 2021-11-01 11:49:36 +11:00
Matt Joiner 87a67db680 Remove unused conn piece inclinations 2021-11-01 11:49:27 +11:00
afjoseph 487352fa5b fixup! [trackerscraper] Add custom DNS lookup function 2021-11-01 11:26:58 +11:00
afjoseph 2a6152b832 [trackerscraper] Add custom DNS lookup function 2021-11-01 11:26:58 +11:00
Matt Joiner 98957b6e8e Only assert pending requests when check is enabled
Uses too much CPU for production from its current callsites.
2021-10-26 14:42:42 +11:00
Matt Joiner 37373864e4 Add more comprehensive pending requests assertions 2021-10-25 16:16:56 +11:00
Matt Joiner d331419604 Demote Torrent.runHandshookConnLoggingErr level to debug 2021-10-21 11:40:06 +11:00
Matt Joiner ff3c186396 Add low requests check
This is an optimization for webseeds, which have 10 synchronous request routines, and if the request count dips below 10, some sit idle. There is probably something similar to be done with PeerConns, which won't update until there are zero requests, but there there is a timer to refresh updates, and the queues are very long (typically 512-2048).
2021-10-21 10:48:43 +11:00
Matt Joiner 8eec0b665e Update webseeds for peer requesting 2021-10-21 10:28:57 +11:00
Matt Joiner a7d3296003 Use roaring.Bitmap.IsEmpty where appropriate 2021-10-19 14:08:56 +11:00
Matt Joiner de87fd3eb1 Avoid allocation putting undirtiedChunksIter into interface 2021-10-19 14:08:56 +11:00
Matt Joiner 529aaa9b1f Use roaring bitmap for pending pieces
Also makes a significant optimization for peerHasWantedPieces possible.
2021-10-19 14:08:56 +11:00