Commit Graph

51 Commits

Author SHA1 Message Date
Matt Joiner 95d808d3c5 Use rejiggered missinggo bitmap 2021-06-07 13:01:39 +10: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 8a2ff43246 Tidy up the interface changes 2020-06-02 17:41:59 +10:00
Matt Joiner 3e9a5a4aec Expose ClientConfig.Extensions
Also run the storage failure test with fast disabled for the seeder. This probably would have tickled some issues in the past, so it seems like a good place to try it out.
2020-04-23 13:03:40 +10:00
Yaroslav Kolomiiets 93430aa01a PEX: add connection tracking 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets 634edd2875 Share current connections with peers over PEX (anacrolix#341) 2020-04-15 17:24:44 +10:00
Matt Joiner cf0d0118ea Finish fixing IP banning on storage errors 2020-01-23 13:54:37 +11:00
Matt Joiner 35cdebdc3b Fix panic in benchmark due to requestStrategy changes 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 cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner 5a2c1c9b76 Upgrade to simplified logger 2019-08-21 20:44:12 +10:00
Matt Joiner 338287486f Always return errors when handshakes or dialing fails
I intend to use xerrors-style error handling for special cases.
2019-07-19 16:15:46 +10: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 6dd3b9c12c Law of Demeter Client.mu 2018-07-25 13:42:28 +10:00
Matt Joiner 324cc7a281 Comments and trivial tweaks 2018-07-12 09:42:00 +10:00
Matt Joiner f5bd377941 Change pieceIndex to peer_protocol.Integer 2018-07-12 09:15:15 +10:00
Matt Joiner 76a3c0891a Expose handshake stuff in peer_protocol 2018-07-07 11:31:29 +10:00
Matt Joiner 2852fee357 Fix some testing code for Config->ClientConfig 2018-06-16 17:01:21 +10:00
Matt Joiner 319e57d1c6 Rework conns to/and allow multiple DHT servers
This will help with #229, and IPv6 support.
2018-04-12 11:41:07 +10:00
Matt Joiner 64c40a45b4 Fix panic in benchmark caused by new logging 2018-01-29 19:16:55 +11:00
Matt Joiner 77806c1f49 More development of the new logging interface 2018-01-29 18:22:21 +11:00
Matt Joiner 53e32ca9dd Start using new log package 2018-01-28 16:07:11 +11:00
Matt Joiner 52524925d2 Add separate piece priorities, and cache pending pieces
Should fix a bug where prioritizing files is not alone sufficient to trigger downloading.
2018-01-25 17:18:36 +11:00
Matt Joiner e3c098441a Add Torrent.setInfo 2018-01-25 17:10:37 +11:00
Matt Joiner e13b0eccbf Make peerID a public type
Wanted it applied to Client Status output
2018-01-06 15:50:45 +11:00
Matt Joiner 3aa1e8f3ef Add a test for behaviour after getting metadata_size and before GotInfo
#208
2017-11-08 19:31:10 +11:00
Matt Joiner b3137b1ede Make type piece public 2017-09-15 19:35:16 +10:00
Matt Joiner 49648b9ae1 Close implicit Client default storage on Client.Close
Fixes #158
2017-06-01 22:57:08 +10:00
Chris Walker 9d96cd659f fix `Spec.Storage` and allow per-torrent dir
`TorrentSpec.Storage` was not honored when calling `Client.AddTorrentSpec`
and the configured `cfg.DefaultStorage` was always used. Now if you construct
your `TorrentSpec` you can specify any `StorageImpl`

Also, the most common use case for custom storage being per-torrent paths for
FileStorage, this adds a `pathMaker` function to the File implementation that
allows customization, along with the default (always use base path) and my use
case (which seemed common enough from the Gitter chat) which is infohash based
subdirectories.

All Public methods have not changed signature, but 1 private method did, hence
the test update.
2017-03-16 14:40:21 +00:00
Matt Joiner bb4d344235 Fix race condition in TestPieceHashFailed 2016-12-13 14:44:00 +11:00
Matt Joiner c8dffdbb11 Add test that dirty chunks are cleared on piece hash failure 2016-12-06 15:41:08 +11:00
Matt Joiner a8e96ce996 When Reader position changes only update piece priorities that may be affected
Seems to significantly reduce CPU load reading from torrents with huge piece counts.
2016-10-31 19:00:08 +11:00
Matt Joiner e1c6892eca Test empty files and zero piece length for both file and mmap storage backends 2016-09-12 17:11:32 +10:00
Matt Joiner 011838998e Add test for issue #111 and #112 2016-09-12 16:53:20 +10:00
Matt Joiner 792ab183e4 Add a benchmark for an observed slow case with Torrent.updatePiecePriorities 2016-08-30 14:21:50 +10:00
Matt Joiner d3a1c79c79 Merge Torrent and torrent types 2016-04-03 18:40:43 +10:00
Matt Joiner 19021f1360 Invalid test
The function is never exposed publicly or called without holding the client lock.
2015-08-05 02:38:36 +10:00
Matt Joiner bb28ff7492 Replace pruning timer with as-required connection dropping 2015-06-30 00:45:26 +10:00
Matt Joiner 842a32ae0c Rewrite import paths for migration from Bitbucket 2015-03-20 16:37:44 +11:00
Matt Joiner a7dddd9be6 Rewrite handshaking and connection management 2015-03-18 18:28:13 +11:00
Matt Joiner 0eb418360b Allow configuring Client torrent data opener, config dir, disabling metainfo cache, and prune with a timer instead of goroutine 2015-02-25 14:48:39 +11:00
Matt Joiner 029d6939f8 Hide some methods that shouldn't be public 2015-02-10 00:12:29 +11:00
Matt Joiner 18d6f81184 Add InfoHash.HexString convenience 2014-12-01 16:34:45 -06:00
Matt Joiner e37d369864 Move half-open tracking into per-torrent 2014-11-16 13:30:44 -06:00
Matt Joiner ced8a7b78f New worst conns algorithm that takes into account connection useful chunk hit rate 2014-09-11 20:31:31 +10:00
Matt Joiner 89be570636 Add a test for double Close of torrent.torrent 2014-08-28 08:03:55 +10:00
Matt Joiner 0dee5d9952 Make Request private 2014-04-16 21:13:44 +10:00
Matt Joiner 1aa1063863 Big visibility/doc clean-up, and extract mmap_span package 2014-04-09 02:36:05 +10:00