Commit Graph

3123 Commits

Author SHA1 Message Date
Matt Joiner f86af21cd2 Improve dht bootstrap stats logging 2021-11-05 09:30:25 +11:00
Matt Joiner eaeb38b18c cmd/torrent: Add serve subcommand 2021-11-04 20:02:55 +11:00
Matt Joiner 59d5e17ace bencode: Fix marshalling of unaddressable array of bytes 2021-11-04 20:01:25 +11:00
Matt Joiner c7ff32f01c Export addTorrentOpts
Now I see what the lint was complaining about.
2021-11-04 20:00:31 +11:00
Matt Joiner bc5cce8dca Move download subcmd code into separate file 2021-11-04 11:36:34 +11:00
Matt Joiner 002de0ebe3 cmd/torrent: Add bencode {json,spew} commands 2021-11-03 13:49:06 +11:00
Matt Joiner 68fdd41d89 bencode.Bytes: Tests and stricter checks 2021-11-02 17:28:05 +11:00
Matt Joiner 1f22c51366 Run Go GitHub action with Go 1.16 as well as 1.17
1.16 is still used by some downstream projects, and it might ensure support for pkg.go.dev (via old build constraint tags).
2021-11-01 12:21:20 +11:00
Matt Joiner 70d15d405c Run Go GitHub action on all branches 2021-11-01 12:21:20 +11:00
Matt Joiner b088c08acd Remove some unused parameter names
https://deepsource.io/gh/anacrolix/torrent/run/cfd6fa3d-c65b-4bf7-83f7-3bee87c21a4b/go/RVV-B0012
2021-11-01 11:53:58 +11:00
Matt Joiner 1788303405 Alter some directory permissioning in storage 2021-11-01 11:50:12 +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 b33b45baf4 [fuzz] Put +build tags to support go1.16 as well 2021-11-01 11:26:58 +11:00
afjoseph 013634d9f1 Revert "Remove old-style build tags"
This reverts commit 11ae25660a.
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 c2ed60f9f2
Link to godocs.io for documentation 2021-10-29 11:57:57 +11:00
Matt Joiner 2c70c23ac4 Fix unnecessary modification of Torrent.CancelPieces API
https://github.com/anacrolix/torrent/issues/681
2021-10-29 11:52:28 +11:00
Matt Joiner 446016cb27 bencode: Encode arrays of bytes as strings
This looks appropriate with the use of byte arrays in DHT for BEP44.
2021-10-28 16:21:23 +11:00
Matt Joiner 8b368b3832 Run all tests and benchmarks twice
This helps detect bad cleanup in tests, which is very common.
2021-10-27 15:15:27 +11:00
Matt Joiner d1e2d7ff92 Remove unnecessary intermediate steps in Go workflow 2021-10-27 15:14:48 +11:00
Matt Joiner f2e9eeba3b Check if torrent is closed before handling peer request data read failures
Should fix panics using storage after its been closed, like in https://github.com/anacrolix/torrent/runs/4017475163.
2021-10-27 15:14:11 +11:00
Matt Joiner eb2fc6dbef Fix panic in benchmark 2021-10-27 13:57:19 +11:00
Matt Joiner ae28d0e0e4 Merge branch 'peer-requesting' 2021-10-27 12:42:26 +11:00
Matt Joiner a7e7cbcb04 Retain the desired request ordering
This means we don't have to randomize the request order when we finally apply it to avoid favouring lower indices. The difference is very subtle but should be impactful with smaller connection counts and rarer torrents.
2021-10-27 10:13:39 +11:00
Matt Joiner 31985f1ea0 Add Peer.mustRequest 2021-10-26 15:03:04 +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 344ada8b7c Add disabled code for limiting wasted chunks 2021-10-25 21:37:25 +11:00
Matt Joiner e7426133e2 Quote webrtc offer ID as ASCII-only 2021-10-25 21:03:51 +11:00
Matt Joiner ccf57798a2 Fix iter pending chunk request offsets 2021-10-25 20:53:39 +11:00
Matt Joiner 3d49a29288 Support minimum peer extensions 2021-10-25 20:52:44 +11:00
Matt Joiner e8067f741f Always count unhandled requests as pending
Fixes https://github.com/anacrolix/torrent/issues/679.
2021-10-25 16:36:58 +11:00
Matt Joiner 28726f737c Record webseed request result bytes against client stats
Should fix the issue where webseeds cause >100% useful data readings.
2021-10-25 16:17:55 +11:00
Matt Joiner 37373864e4 Add more comprehensive pending requests assertions 2021-10-25 16:16:56 +11:00
Matt Joiner 506996d038 Fix panic in update requests timer func on closed conn 2021-10-25 16:16:06 +11:00
Matt Joiner e178f99f35 Fix race running and closing webtorrent tracker clients 2021-10-25 16:15:42 +11:00
Matt Joiner e884b8079b Fix panic when sustaining unrejected requests after being choked
Fixes https://github.com/anacrolix/torrent/issues/680.
2021-10-25 13:00: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 faf385c163 cmd/torrent: Use updated args module 2021-10-20 16:41:33 +11:00
Matt Joiner 92d3e1ed6d Remove unused peerImpl methods 2021-10-20 16:35:45 +11:00
Matt Joiner 200f5e5140 go mod tidy 2021-10-20 11:36:48 +11:00
Matt Joiner 9625553fd2 Demote some recent logs to debug 2021-10-20 11:22:35 +11:00
Matt Joiner e31e191c8d Improve protocol behaviour logging 2021-10-20 11:22:20 +11:00
Matt Joiner 11e1080b40 go fmt 2021-10-19 14:08:56 +11:00
Matt Joiner e51accb3e2 Don't error receiving unchoke while already unchoked 2021-10-19 14:08:56 +11:00
Matt Joiner b50e941d1d Refresh updates after 3s instead of 1s 2021-10-19 14:08:56 +11:00
Matt Joiner 4ce06bef00 Randomize request order 2021-10-19 14:08:56 +11:00