Commit Graph

23 Commits

Author SHA1 Message Date
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
Matt Joiner a0a715c6f6 Fix calculation of request for torrent data offset 2014-04-08 16:45:33 +10:00