2
0
mirror of synced 2025-02-24 06:38:14 +00:00

2233 Commits

Author SHA1 Message Date
Matt Joiner
dff436f102 Rename connection->PeerConn and fix exports 2020-02-21 11:07:50 +11:00
Matt Joiner
01955ebe80 Tweak DHT status output 2020-02-21 09:47:46 +11:00
Matt Joiner
afe4d8795d Support custom DHT servers
Addresses #266.
2020-02-20 17:46:29 +11:00
Matt Joiner
71f18f1042 Remove ClientConfig.ProxyURL and DefaultHTTPUserAgent
ProxyURL is no longer used for implicit sockets, this will ensure consumers are aware. It's other behaviour is already more correct specified through HTTPProxy.

DefaultHTTPUserAgent was vestigial, and is specified now through the ClientConfig.
2020-02-20 17:04:11 +11:00
Matt Joiner
3505d126d4 TestClientDisabledImplicitNetworksButDhtEnabled 2020-02-20 16:57:28 +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
0d4858ba29 Extract the transfer tests
We need them external the torrent package so we can test the API for adding dialers and listeners.
2020-02-20 13:57:24 +11:00
Matt Joiner
e9e128cbf8 Split Client dialers and listeners 2020-02-20 11:10:05 +11:00
Matt Joiner
376ff763fe Apply staticcheck 2020-02-20 11:09:57 +11:00
Matt Joiner
1137956861 Remove funding file
It's drawn automatically from anacrolix/.github now.
2020-01-29 09:12:49 +11:00
Matt Joiner
466cced13a Make use of requestStrategyDefaults in more places 2020-01-24 19:24:28 +11:00
Matt Joiner
53e334d3f2 Move all the request strategy stuff into its file 2020-01-24 17:55:20 +11:00
Matt Joiner
538efd12bd Restore the default duplicate request timeout strategy 2020-01-24 17:34:07 +11:00
Matt Joiner
48eb7ff3f2 Expose request strategies 2020-01-24 17:30:57 +11:00
Matt Joiner
2044457959 Fix unimplemented hooks in request strategies one and two 2020-01-24 15:09:39 +11:00
Matt Joiner
737596d3df go get -u && go mod tidy 2020-01-23 14:16:46 +11:00
Matt Joiner
913f6df80d Use CopyN to ensure early io.EOF isn't ignored when hashing pieces 2020-01-23 13:56:39 +11:00
Matt Joiner
2c1afff8b3 Skip 1 frame in reader.log 2020-01-23 13:55:40 +11:00
Matt Joiner
cf0d0118ea Finish fixing IP banning on storage errors 2020-01-23 13:54:37 +11:00
Matt Joiner
4fae1f81df Record connection dirtied piece before queuing for hash
Not a bug, but probably more robust.
2020-01-23 13:52:17 +11:00
Matt Joiner
dc643d2ed3 Update code comments 2020-01-23 13:51:14 +11:00
Matt Joiner
1d5b8f7451 Reflow some comments 2020-01-22 15:56:16 +11:00
Matt Joiner
dc39e98cfb Fix race in requestStrategyThree request timeout callback 2020-01-20 11:51:24 +11:00
Matt Joiner
ff8ce944e9 Upgrade github.com/pkg/errors@v0.9.0 2020-01-14 15:42:27 +11:00
Matt Joiner
cfc68d3ae6 Fix bad init of Torrent.requestStrategy 2020-01-14 10:51:09 +11:00
Matt Joiner
35cdebdc3b Fix panic in benchmark due to requestStrategy changes 2020-01-14 10:51:09 +11:00
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