2
0
mirror of synced 2025-02-24 14:48:27 +00:00

252 Commits

Author SHA1 Message Date
Matt Joiner
446e11b1fc Missing error checks in test 2016-03-30 19:16:40 +11:00
Matt Joiner
c0e060de63 Suppress logging noise in tests 2016-03-30 19:12:57 +11:00
Matt Joiner
7790e72832 Move storage.FileStore interface to missinggo 2016-03-30 19:12:33 +11:00
Matt Joiner
5856b91af0 Fix missinggo import 2016-03-30 19:11:55 +11:00
Matt Joiner
ee22446440 Reimplement piece storage 2016-03-29 11:14:34 +11:00
Matt Joiner
a5b54f21a1 Make opening a torrent in storage an explicit method
This is storage types where opening can fail, like mmap
2016-03-28 22:40:29 +11:00
Matt Joiner
775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner
b97b50aca9 New storage interface 2016-03-28 20:38:30 +11:00
Matt Joiner
ac184c8f52 Tidy up a test that fails with the wrong reasons 2016-03-24 23:52:38 +11:00
Matt Joiner
0c877a9d94 Add a test for bad have messages
The reason for the cleanup to peer have-related messages in the first place.
2016-03-22 13:09:02 +11:00
Matt Joiner
67aea29ba9 Extend the timeout, drone.io is slow? 2016-02-26 22:18:08 +11:00
Matt Joiner
a8ad7dfd0e Add test checking that cancel works 2016-02-26 22:10:29 +11:00
Matt Joiner
5cc8d8a652 Catch error creating client in tests 2016-02-26 22:10:09 +11:00
Matt Joiner
976510db60 Add DHT nodes from metainfo when added to Client 2016-02-24 21:56:50 +11:00
Matt Joiner
5665505dc7 Test that metainfo nodes are added to the DHT 2016-02-24 01:48:44 +11:00
Matt Joiner
c03593bc01 Catch error creating new client in test 2016-02-22 14:30:02 +11:00
Matt Joiner
033c95d73b Add a client transfer test with limited file cache, and a second pass read 2016-02-22 02:41:07 +11:00
Matt Joiner
c50742fdac Move exportClientStatus to testutil.ExportStatusWriter 2016-02-22 02:36:41 +11:00
Matt Joiner
fd42ed877f Don't run TestCompletedPieceWrongSize in parallel because it messes up logs 2016-02-22 00:31:06 +11:00
Matt Joiner
c64ad19dbb Test a ton of permutations for readahead and responsive 2016-02-22 00:30:42 +11:00
Matt Joiner
4846021c0c Tidy up TestClientTransfer 2016-02-21 22:08:01 +11:00
Matt Joiner
d5f888069f Ditch Data.WriteSectionTo, and fix cmd/torrent-verify 2016-02-18 11:45:31 +11:00
Matt Joiner
dcce061152 Rework Reader reading, and TestCompletedPieceWrongSize 2016-02-17 18:26:10 +11:00
Matt Joiner
7ab984ab52 Add a test for starting a torrent where pieces are already complete 2016-02-17 17:09:05 +11:00
Matt Joiner
0f9f7ba01b Add torrent.completedPieces bitmap
Reduce load on data.PieceComplete for torrents with lots of pieces, when reader position changes. Not sure of the improvement yet.
2016-02-17 00:00:55 +11:00
Matt Joiner
dc215d083e Export PieceStateChange through piece state change pubsub 2016-02-07 21:55:47 +11:00
Matt Joiner
0c28a0f1b1 Use new tracker package interface 2016-02-07 18:49:35 +11:00
Matt Joiner
b4f04ddc61 Missing Reader.Close in some tests 2016-02-05 01:17:26 +11:00
Matt Joiner
b8e9ef4be2 Export leecher and seeder in TestClientTransfer 2016-02-01 21:09:25 +11:00
Matt Joiner
eb838a894c newTorrent doesn't need to return error 2016-02-01 07:05:43 +11:00
Matt Joiner
94d764e6be Readers changing wasn't triggering waitAccept
Caused occasional stall in TestSeedAfterDownloading.
2016-01-25 04:14:19 +11:00
Matt Joiner
9f79838033 require->assert in test 2016-01-19 01:41:33 +11:00
Matt Joiner
06445f2a1e It's working and the tests are usually passing
I still need to handle "prefetch"-style downloading, and some functions haven't been committed to force this issue.
2016-01-18 18:35:14 +11:00
Matt Joiner
89a6a20af6 Finally make Torrent.torrent private
A lot of code was using unintentionally exported stuff from the embedded *torrent in Torrent.
2016-01-17 00:14:15 +11:00
Matt Joiner
8696f32e58 Make Config.DHTConfig not a pointer 2016-01-17 00:12:53 +11:00
Matt Joiner
2beb5f8bd4 Track dirty chunks, instead of pending chunk specs
This is the first step toward having purely Reader-based priorities. If a chunk is pending, that currently implies that we want to download it. I want to move that kind of state out to the readers.
2016-01-13 17:11:59 +11:00
Matt Joiner
153c13db43 Revert "Merge pull request #54 from zhulik/master"
This reverts commit 5cf75b869c469196a8473c4962b99a450daaeeec, reversing
changes made to 09050ff2c5607f3991e6ec6422ed57ba0dee0bad.
2016-01-06 12:19:49 +11:00
Gleb Sinyavsky
5b790bf874 Torrent structs replaced with Download interface in exported Client methods 2015-12-27 14:49:15 +03:00
Matt Joiner
bc5d79e1d3 Make torrent.Reader reads fail when the torrent is closed instead of stalling 2015-11-06 00:40:47 +11:00
Matt Joiner
d01c6221e6 Remove sync.Cond from piece
It's not trivial to ensure that anyone waiting on the piece Cond will wake on events like the torrent being dropped from the client.
2015-11-06 00:40:16 +11:00
Matt Joiner
b3a8020401 Store pieces inplace in torrent.Pieces
This should save some allocation overhead, especially for torrents that have 20k+ pieces.
2015-10-16 22:10:03 +11:00
Matt Joiner
b0b5794890 Create a pieceStore interface, and merge in my httpfile backend, and replace data/blob
data/blob was aging, and had severe performance problems. It's now possible to use missinggo/filecache as a data backend to pieceStore which is better tested and performs excellently.
2015-10-04 00:22:46 +10:00
Matt Joiner
efe294ac35 utp package merged PacketConn with Socket 2015-10-04 00:02:14 +10:00
Matt Joiner
b7a8bb7570 Simplify the torrent Data interface
None of the methods are optional anymore. Removed the nasty wrappers for some data implementations. Moved data.Data back into the main torrent package. Should make it much easier to understand for people implementing their own Data implementations.
2015-10-02 00:09:04 +10:00
Matt Joiner
afed0b7ce3 Add a test for dropping a torrent before it gets the Info
Really just to check the behaviour doesn't change, it was mentioned before but wasn't the actual cause of any problem.
2015-09-17 12:53:52 +10:00
Matt Joiner
eebd09c0fe Allow subscribing to torrent piece state changes 2015-09-06 12:33:22 +10:00
Matt Joiner
2202a31b85 Add tests inspired by issue #27 2015-08-23 12:50:32 +10:00
Matt Joiner
0f606a2d24 Add TestSeedAfterDownloading 2015-08-12 16:51:12 +10:00
Matt Joiner
502a7ebebd utp.NewSocket now takes network parameter 2015-08-05 02:51:40 +10:00
Matt Joiner
51aad774ab Add IPBlocklist option to Config, and test it's inherited by DHT 2015-08-04 01:07:22 +10:00