Commit Graph

238 Commits

Author SHA1 Message Date
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 5cf75b869c, reversing
changes made to 09050ff2c5.
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
Matt Joiner 8d581ce7f2 Fix utp.Socket leak in test 2015-08-04 00:48:17 +10:00
Matt Joiner d077fed72d Some utils moved to missinggo 2015-08-04 00:29:01 +10:00
Matt Joiner 64848a206a Replace go-check with testify
It's muuuuch better.
2015-08-03 16:23:05 +10:00
Matt Joiner a8ff6c2daf Add TestResponsive 2015-07-15 15:51:42 +10:00
Matt Joiner c018c660f0 Allow chunk size to be specified per torrent 2015-07-15 15:31:18 +10:00
Matt Joiner d8cf0f1e34 Add benchmark for adding a torrent with a lot of pieces 2015-06-22 19:43:22 +10:00
Matt Joiner b2b290a589 Small tweak to readahead, and fix the tests 2015-06-16 17:14:15 +10:00
Matt Joiner ced5733c88 Improve uploading/seeding 2015-06-16 16:57:47 +10:00
Matt Joiner 07ed952834 Test bad "completed" piece 2015-06-03 00:16:38 +10:00
Matt Joiner b34b583919 Reduce number of messages sent in one test, the OS nondeterministically fails the test sometimes otherwise 2015-05-24 21:37:14 +10:00
Matt Joiner 5b750e8dbd Expose GOPPROF for debugging torrent package 2015-05-20 22:20:11 +10:00
Matt Joiner 1cf591dc3d Switch to using a slice for tracking pending chunks. Saves massive amounts of memory. 2015-05-16 10:51:48 +10:00
Matt Joiner c5208569ca Apply sortimports 2015-04-30 00:31:34 +10:00
Matt Joiner 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Matt Joiner 28b299e7c8 Rework the Torrent Reader interface, to allow reader options, and add "responsive" as one such option
Had several weeks of testing. Removes a lot of the "helper" reading methods, but this was necessary to allow per-Torrent reading options.
2015-04-14 23:59:41 +10:00
Matt Joiner 6582cffe06 AddTorrentSpec now merges in new information an existing torrent didn't have 2015-03-28 02:50:55 +11:00
Matt Joiner 3aa78763aa Use rogpeppe's sortimports to fix this goimports ordering madness 2015-03-26 17:18:08 +11:00
Matt Joiner 842a32ae0c Rewrite import paths for migration from Bitbucket 2015-03-20 16:37:44 +11:00
Matt Joiner 29238ff23f Change the interface to add torrents to a Client 2015-03-18 18:32:31 +11:00
Matt Joiner e85b7e228b Add support for Fast Extension 2015-03-12 20:06:23 +11:00
Matt Joiner 5b2a91e24a Use testing config 2015-03-11 04:22:56 +11:00
Matt Joiner ad6ac3f2cd More cleaning of public interface 2015-03-08 17:28:14 +11:00
Matt Joiner 3e753bb8ad Change up the data storage interfaces a bit 2015-03-07 17:11:45 +11:00
Matt Joiner e4dec03a32 Change the way readahead pieces are calculated 2015-03-04 13:07:11 +11:00
Matt Joiner a2d69b4931 Make blob data stateful 2015-02-27 12:45:55 +11:00
Matt Joiner 8f744300cc Add piece blob torrent.Data storage, and move testutil to internal/, add basic transfer test for Client and blob 2015-02-27 01:46:02 +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 bad7df778a Hopefully maybe fix bind error on Codeship test runner 2015-02-21 15:25:34 +11:00
Matt Joiner 3c9fdba345 uTP raw Socket use is now via .PacketConn 2015-02-10 00:17:04 +11:00
Matt Joiner 4ca6b4e2c7 Fix some stuff Rob Clifford broke through stress testing 2015-02-06 14:54:59 +11:00
Matt Joiner c303ce09d8 Fix a few tests 2015-01-11 21:42:57 +11:00
Matt Joiner 39b9eb1d37 Switch to my own UTP library 2015-01-08 23:26:39 +11:00
Matt Joiner 8b7548e7a0 Fix sending to localhost on OSX 2014-12-26 17:19:01 +11:00
Matt Joiner 998d85ba50 :) 2014-12-08 21:59:01 -06:00
Matt Joiner 7ba25ce936 A probably unhelpful test that ensures UTP performs 2014-12-03 19:57:43 -06:00
Matt Joiner 91c2c1f5c7 Piece priorities, torrent read interface and many fixes 2014-12-03 01:07:50 -06:00
Matt Joiner c75f79b097 Speed up tests, allow -short for some UDP tracker stuff 2014-12-02 14:23:01 -06:00
Matt Joiner 358f089515 Set a minimum dial timeout 2014-11-18 21:53:00 -06:00
Matt Joiner 8cae78cbf1 Reduce dial timeouts when there are lots of peers in the backlog 2014-11-17 18:04:09 -06:00
Matt Joiner e37d369864 Move half-open tracking into per-torrent 2014-11-16 13:30:44 -06:00
Matt Joiner 5c1492bffe Add CopyExact util function 2014-08-21 18:24:19 +10:00
Matt Joiner 40fd1d647c Tidy up the torrent and DHT APIs 2014-08-21 18:07:06 +10:00
Matt Joiner 28afa748e7 API changes in github.com/anacrolix/libtorgo 2014-07-13 17:37:12 +10:00
Matt Joiner e947ce2ee4 Run go vet on everything 2014-07-10 02:59:37 +10:00
Matt Joiner eb070383b1 Move download strategies into their own file 2014-06-30 00:22:05 +10:00
Matt Joiner 51431c7cfc Some minor tweaks 2014-06-29 19:10:59 +10:00
Matt Joiner 3b29043861 Add peers sent over PEX 2014-06-29 19:07:43 +10:00
Matt Joiner c96293a111 Can now download from magnet links 2014-06-28 19:38:31 +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 1c95eda249 Test created torrent structure in current directory 2014-03-20 17:35:11 +11:00
Matt Joiner fa000c4f88 Improvements to pending chunks; extract testutil 2014-03-20 16:58:09 +11:00
Matt Joiner 2e81f914e7 Add a end-to-end test for torrentfs
Basic unchoking and uploading.
Accept incoming connections.
Break out torrentfs lib.
Fix and implement some protocol stuff.
2014-03-18 01:44:22 +11:00