Commit Graph

2257 Commits

Author SHA1 Message Date
Matt Joiner 2559af0f9c Extract the request timeout stuff into requestStrategyThree 2020-01-14 10:51:09 +11:00
Matt Joiner 4c989da21e Extract the request strategy logic
Bit messy. Now it'll be easier to clean-up what it depends on, and test.
2020-01-14 10:51:09 +11:00
Matt Joiner 5a1af60e96 Formatting 2020-01-14 10:51:09 +11:00
Matt Joiner 381fb293a5 Fix typos and spellos in comments 2020-01-14 10:51:09 +11:00
Matt Joiner 31fdcb3463 Update missinggo 2020-01-14 10:51:09 +11:00
Matt Joiner 72e54fb353 Resource per piece storage: Store incomplete chunks separately 2020-01-14 10:51:09 +11:00
Matt Joiner 1039e00955 When piece checks fail only ban untrusted peers and only when the entire piece is dirty
This should help with addressing https://github.com/anacrolix/torrent/issues/364.
2020-01-14 10:51:09 +11:00
Matt Joiner bf0498ed5a Improve hash piece error logging 2020-01-14 10:51:09 +11:00
Matt Joiner b9fb0bf2a2 Don't create piece hashers for closed Torrents 2020-01-14 10:51:09 +11:00
Matt Joiner 4911b29903 Use subtests in TestClientTransferVarious 2020-01-14 10:51:09 +11:00
Matt Joiner 814a714459 Propagate back piece hashing errors
Attempting to solve https://github.com/anacrolix/torrent/issues/364.
2020-01-14 10:51:09 +11:00
James Lawrence ad73cf8611 fixes various vet errors 2020-01-14 09:09:09 +10:00
Matt Joiner 98bd488466 Fix a log level 2020-01-07 10:50:18 +11:00
Matt Joiner c9f9235117 Fix panic in logging
Found by @ccampbell.
2020-01-07 10:44:58 +11:00
Matt Joiner e80834b899
Update FUNDING.yml 2020-01-06 09:02:11 +11:00
Matt Joiner baefdfd9ea Disable accept rate limiting by default
It messes with any non-standard usage, like localhost etc. It might even just be a bad idea when interacting with clients that behave like ourselves: opening connections with varying encryption and protocols simultaneously to each peer.
2020-01-04 17:17:56 +11:00
Matt Joiner bd4176f5ea cmd/torrent: Disable accept rate limiting 2020-01-04 17:16:48 +11:00
Matt Joiner 3a733e530c Improve logging and errors for accept rate limiting 2020-01-04 17:14:18 +11:00
Matt Joiner 6cc65683e5 Revert to log v0.4.0 2020-01-04 16:43:15 +11:00
Matt Joiner 8323dd9a14 cmd/torrent: Move log setup earlier to avoid race 2020-01-04 16:41:18 +11:00
Matt Joiner 5746877e1d cmd/torrent: Synchronize stopping 2020-01-04 16:41:02 +11:00
Matt Joiner 01f9fdb921 Upgrade to log v0.5.0 2020-01-03 15:37:08 +11:00
Matt Joiner bfbed8ab6d cmd/torrent: Make the addr flag a string
This avoids tagflag trying to resolve it, and then passing a bad IP for different listen networks. There's also a patch to tagflag so it doesn't do this anymore.
2020-01-03 14:51:26 +11:00
Matt Joiner e24a9b343f cmd/torrent: Add dht flag 2020-01-03 14:51:26 +11:00
Steve Yoon d34dfa6575 propagate proxy url parsing err 2020-01-02 09:18:14 +10:00
Sick Yoon 32579e72c7 disable listeners if proxy is configured 2020-01-02 09:18:14 +10:00
Matt Joiner 76f1516d3a Update dht to v2.3.1
Fixes a race in bootstrap stats.
2019-12-29 13:00:20 +11:00
Matt Joiner d4e90519e6 Use new anacrolix/multiless, and incorporate Peer.Trusted into peer prioritization 2019-12-23 14:04:07 +11:00
Matt Joiner cf85d70a5c bencode: Rename string_values->stringValues 2019-12-23 13:39:34 +11:00
Matt Joiner 4104880a66 Remove unnecessary locking in Torrent.Piece 2019-12-18 16:49:15 +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 9e1804f52e Switch back to anacrolix/sync for the Client lock 2019-12-17 20:49:40 +11:00
davtoro 82e1c81a9a Possibility to change UPnP ID (#354) 2019-12-16 13:22:24 +11:00
Matt Joiner f448f55e88 Coalesce piece state change notifications on client unlock
Reported by Craig Campbell <iamcraigcampbell@gmail.com>.
2019-12-13 15:55:56 +11:00
Yates 790ba6af3c use path.utf8 first for some torrent (#350) 2019-12-08 20:35:40 +11:00
D. HT. Yu 6e95274413 fix if statement in `cmd/torrent/main.go` (#349) 2019-12-08 20:34:24 +11:00
i96751414 f15aa27e24 Fix bytesLeft for files (#348)
* Refactor (*File).bytesLeft

* Always use the same piece size
2019-11-30 19:53:35 +11:00
Matt Joiner 61fa4bf51f Update deps 2019-11-28 12:51:25 +11:00
Matt Joiner d26b93cff4 Add comments on File.{first,end}PieceIndex 2019-11-28 12:51:25 +11:00
Matt Joiner e08da0e6e0 Change File.endPieceIndex calculation
I think previously it would round-up when it shouldn't.
2019-11-28 12:51:25 +11:00
i96751414 f22acca804 Add BytesCompleted method for files (#347)
* Add BytesCompleted method for files

* Make sure we check limit pieces correctly

* Remove unnecessary info check
2019-11-26 11:54:26 +11:00
Matt Joiner da2d174fc9 Include piece index in log message 2019-11-20 20:04:47 +11:00
Anthony Raymond 8638ed1c75 Anthonyraymond export well known (#346)
* Export HttpResponse from tracker/http.go

* Update http_test.go
2019-11-20 16:31:54 +11:00
Anthony Raymond ec56d59137 Export Peer function (#343)
* Export function to be use-able in library

* Update method call
2019-11-15 10:22:59 +11:00
Matt Joiner a298d295b2 Use latest golang.org/x/time
Includes rate.Limiter.SetBurst{,At}.
2019-11-07 08:56:56 +11:00
Matt Joiner 659f7e0371 Include traversal stats in completed bootstrap log message 2019-11-07 08:51:14 +11:00
Matt Joiner f98ff7507e Use default connection tracking values 2019-11-04 12:11:26 +11:00
Matt Joiner 83867dbbe9 Move entirely to etcd-io/bbolt 2019-11-04 09:19:07 +11:00
Matt Joiner d71f2175c4 Moved to anacrolix/stm 2019-11-03 13:04:46 +11:00
Matt Joiner 94dfd312f0 Use stm versions of dht and missinggo, and use anacrolix/stm 2019-11-02 22:41:53 +11:00