Commit Graph

241 Commits

Author SHA1 Message Date
Matt Joiner 35464677ef Improve metainfo.MetaInfo.Magnet interface and add tests 2021-02-24 12:11:47 +11:00
Matt Joiner 7f7c59d52e Replace internal/tmproot with Testing.TB.TempDir 2021-02-22 14:30:09 +11:00
Matt Joiner f5915ad12c Use iotest.TestReader 2021-01-29 23:32:01 +11:00
Matt Joiner 456a2f7c5d Expose more callbacks and Request and ChunkSpec 2021-01-28 14:23:22 +11:00
Matt Joiner cb5f80ec11 Improve configurability and add PutSized to sqlite storage 2021-01-25 15:54:37 +11:00
Matt Joiner 27108bd2f7 Export Peer 2021-01-25 15:49:48 +11:00
Matt Joiner ded6c19edb Add the DropMutuallyCompletePeers ClientConfig field 2021-01-05 16:58:45 +11:00
Matt Joiner 898260c177 Tidy up some storage close handling 2020-10-11 12:40:43 +11:00
Matt Joiner 3d7a95a65d Use testing.T.Name instead of missinggo.GetTestName
This handles subtests correctly, and removes the need to specify when to export due to collisions with the old function.
2020-10-10 10:59:17 +11:00
Matt Joiner 02adc3f2ee Break peer out from PeerConn 2020-05-30 10:14:20 +10:00
Matt Joiner 5b0c46cd54 Fix false positive Goland code lint 2020-04-16 14:52:52 +10:00
Matt Joiner e5f7765dfa Fix small cache transfer tests
Since hashing Peer Addrs in the Torrent pending peers, clients are getting more than one connection to the seeder in the tests and failing.
2020-04-16 14:12:17 +10:00
Matt Joiner c83738f3f4 Update to latest anacrolix/dht 2020-03-17 13:47:53 +11:00
Matt Joiner c855c7a366 Differentiate between storage.ClientImpl{,Closer} 2020-02-21 14:12:44 +11:00
Matt Joiner 7d25cfdd1d Move envpprof imports around 2020-02-21 12:58:47 +11:00
Matt Joiner dff436f102 Rename connection->PeerConn and fix exports 2020-02-21 11:07:50 +11:00
Matt Joiner afe4d8795d Support custom DHT servers
Addresses #266.
2020-02-20 17:46:29 +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 72e54fb353 Resource per piece storage: Store incomplete chunks separately 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 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 f448f55e88 Coalesce piece state change notifications on client unlock
Reported by Craig Campbell <iamcraigcampbell@gmail.com>.
2019-12-13 15:55:56 +11:00
Matt Joiner 63993a3dc2 Add a test for issue #335 2019-10-11 17:34:07 +11:00
Matt Joiner ff9d845006 Add code for dumping log Msg values to TestingConfig 2019-10-03 19:12:33 +10:00
Matt Joiner ee5e459ea3 Tidy up piece completion change handling 2019-08-21 21:06:39 +10:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner 9224303c1e Update all imports of dht to v2 2019-08-10 18:46:07 +10:00
Matt Joiner 958ff01eab Change the default client port 2019-07-19 16:19:21 +10:00
Matt Joiner f0e7f5e7a0 Add an error check in a test
Managed to get this to fail, and it just panicked.
2019-07-19 16:17:10 +10:00
Matt Joiner 1d8873552a Rework header obfuscation and add tests for fallbacks 2019-07-19 13:23:36 +10:00
Matt Joiner 09b587f17b Comments 2019-07-19 13:04:10 +10:00
Matt Joiner cde8062e75 Report allocs in BenchmarkAddLargeTorrent 2019-01-30 15:19:32 +11:00
Matt Joiner ddbba214da Fix test for dht query context changes 2019-01-21 22:36:40 +01:00
Matt Joiner 6bb761ab6d Simplify single case select 2018-11-28 10:32:44 +11:00
Matt Joiner 4f5387cbbd Fix benchmark broken by changes to client listeners 2018-11-04 17:51:32 +11:00
Matt Joiner 1a4950ad4a Add default DHT servers when UTP disabled
Also ensures that UDP and TCP sockets are reserved, even if not used, and fixes tests. Fixes #289.
2018-11-04 17:43:47 +11:00
Matt Joiner 8a0f333bb9 Add test for dht servers when utp disabled
#289
2018-11-04 17:42:12 +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 2940f27f9f Use the new firewall callback support in go-libutp 2018-07-25 17:11:09 +10:00
Matt Joiner 6dd3b9c12c Law of Demeter Client.mu 2018-07-25 13:42:28 +10:00
Matt Joiner 50def7a688 Move PEX stuff into peer_protocol 2018-07-10 11:21:24 +10:00
Matt Joiner 57849844ae Rework status export in tests to allow count > 1 without a server for every test 2018-06-26 19:54:48 +10:00
Matt Joiner 0f5a2f0c05 Disable accept rate limiting by default in tests 2018-06-17 21:20:41 +10:00
Matt Joiner 68e88977d5 Remove TestUTPRawConn
It's a bit racy and depends on flaky network. Something like this belongs in the utp package anyway.
2018-06-16 20:17:05 +10:00
Matt Joiner e97f487d2e Rename Config->ClientConfig and change how defaults work
This is a very breaking change.
2018-06-16 16:30:04 +10:00
Matt Joiner c9187bf736 Update some tests now that adding connections is more reliable 2018-06-13 22:02:30 +10:00