Commit Graph

108 Commits

Author SHA1 Message Date
Matt Joiner 2aa20b3e22 Don't verify data at startup, add Torrent.Piece.VerifyData and Torrent.VerifyData for this purpose
This has the side effect of deflaking a lot of tests that race to verify data when a torrent is added.
2017-09-15 19:22:32 +10:00
Matt Joiner 0388ec1eee Synchronize Torrent.Info 2017-08-29 15:16:53 +10:00
Matt Joiner cd20c2df36 Fix handling of infohash as hex in Torrent.String 2017-07-01 16:02:06 +10:00
Denis Kuzmenok 8cae956528 added few helper functions: t.PieceBytesMissing, r.CurrentPos, r.SetNonResponsive 2017-06-02 07:46:28 +03:00
Matt Joiner a959bdd0f8 Revert "Quick fix for missing MetaInfo.Announce everywhere with trackers"
This reverts commit b7a8d08bbf.
2017-02-15 18:40:30 +11:00
Matt Joiner b7a8d08bbf Quick fix for missing MetaInfo.Announce everywhere with trackers 2017-02-13 22:28:42 +11:00
Matt Joiner 1d54b1c6d8 Massively reduce CPU when Readers are blocked on unavailable data 2017-02-01 16:28:16 +11:00
Matt Joiner dc7428db54 Reader.Close: Prefer to lock Client in public method 2016-10-31 19:05:33 +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 0e221dbdcd Optimize piece priorities when reader position changes
Gives a decent boost to throughput and reduces a lot of CPU when reading very quickly from Reader.
2016-10-23 16:33:26 +11:00
Matt Joiner 8b17d2a63a Rework Reader position changes affecting piece priorities
Torrent.updatePiecePriorities is always followed by Torrent.piecePriorityChanged, so move it into the former function. Also drop the separate mutex for Reader, and add a missing Reader.posChanged call.
2016-08-30 15:41:26 +10:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner b84298351a Move a few methods to Torrent, and track how many DHT announces occur
I suspect that DHT announces may occur too regularly, or without a break for torrents that aren't able to get over the lower water pending peer mark.
2016-06-15 15:29:47 +10:00
Matt Joiner 5051d1dcd0 Add Torrent.AddTrackers 2016-05-23 10:18:58 +10:00
Matt Joiner 20870ec4ff Rework torrent tracker scraping
New scrapers are added anytime trackers are added to a torrent. In the future they will also be stopped as soon as they're removed. All trackers are concurrently scraped, the old-style of sticking to one tracker that works is abandoned for now.
2016-05-22 22:45:08 +10:00
Matt Joiner b714da8184 Torrent.AddPeers can't fail, so don't return an error 2016-05-12 12:26:09 +10:00
Matt Joiner 528836ab4c Get rid of obsoleted Torrent.ceaseNetworking, and clean up Torrent.closing 2016-05-11 21:44:55 +10:00
Matt Joiner c4a6f66a95 Lock now required around missinggo.Event variables 2016-05-09 16:44:06 +10:00
Matt Joiner a45a09b877 Rework setting of info bytes 2016-05-09 15:47:39 +10:00
Matt Joiner f6b83130c9 Move a bunch of Torrent methods from client.go 2016-05-03 16:47:11 +10:00
Matt Joiner 1fab765329 Change the behaviour of Torrent.Length with when info isn't available 2016-04-20 20:10:39 +10:00
Matt Joiner 61acdf6184 Improve some docs 2016-04-20 20:10:10 +10:00
Matt Joiner dcec4f3dce Improve doc on Torrent.Drop
https://github.com/anacrolix/torrent/issues/73
2016-04-18 21:52:30 +10:00
Matt Joiner b80bb6393a Use metainfo.Hash for piece and info hashes 2016-04-04 13:01:31 +10:00
Matt Joiner d3a1c79c79 Merge Torrent and torrent types 2016-04-03 18:40:43 +10:00
Matt Joiner 08830b97a1 Make everything on type torrent private 2016-04-03 16:50:53 +10:00
Matt Joiner 775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner dcdf85a474 Ditch the torrent stateMu for the client mutex 2016-02-21 03:31:50 +11:00
Matt Joiner 3c801bed27 Export torrent.String to Torrent 2016-02-20 14:39:56 +11:00
Matt Joiner 54b538d322 Export Torrent.PieceState() 2016-02-07 21:57:57 +11:00
Matt Joiner 63c73e18b3 Add File.Cancel 2016-02-05 01:18:54 +11:00
Matt Joiner afa264e6c5 Reintroduce connection piece inclinations, and begin caching piece priorities 2016-02-01 21:11:41 +11:00
Matt Joiner 779085c6fe Remove obsolete note about priorities 2016-01-28 17:22:10 +11:00
Matt Joiner 2f40c48d37 Fix the download/prioritize piece functions
This involves adding a pendingPieces field to torrent.
2016-01-19 01:28:56 +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 8bbfcfcaa4 Resurrect some comments on Torrent methods 2016-01-17 01:49:34 +11:00
Matt Joiner 1a20ac23da Reexport Torrent.MetaInfo 2016-01-17 01:49:04 +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 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 48c3df2d43 Refactorings 2016-01-05 11:48:16 +03:00
Gleb Sinyavsky be8e44da3c peersKey is a public type now 2015-12-27 15:27:32 +03:00
Gleb Sinyavsky fd34e0a3c1 Download.Peers() func added 2015-12-27 15:19:39 +03:00
Gleb Sinyavsky 5b790bf874 Torrent structs replaced with Download interface in exported Client methods 2015-12-27 14:49:15 +03:00
Matt Joiner 8a6ae76686 Standardize Torrent method receivers 2015-12-12 14:03:25 +11:00
Matt Joiner 86c4c609f1 Expose Torrent.SetDisplayName 2015-12-12 14:03:04 +11:00
Matt Joiner 83045db3e5 Docs 2015-12-12 14:00:07 +11:00
Matt Joiner 2bdb6a14da Expose torrent.Seeding 2015-11-22 18:44:33 +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 eebd09c0fe Allow subscribing to torrent piece state changes 2015-09-06 12:33:22 +10:00
Matt Joiner 5ea0c26717 Some doc comments 2015-09-06 12:31:23 +10:00
Matt Joiner 06ebc4c37e Explicitly import Torrent.InfoHash 2015-08-02 03:55:48 +10:00
Matt Joiner 8ce61e911d Torrent.BytesCompleted was racy 2015-07-21 22:54:02 +10:00
Matt Joiner 4b6c8b1c39 Move methods to correct file 2015-06-23 02:02:22 +10:00
Matt Joiner 7e8ee950bc Docs and comments 2015-06-03 13:30:55 +10:00
Matt Joiner 21fb4933fc Change the way piece state is exposed to give more detail 2015-06-01 18:22:12 +10:00
Matt Joiner ca74d8ed33 Made Torrent.GotInfo a function, to avoid use of zero-initialized channel 2015-04-30 00:30:19 +10:00
Matt Joiner 0ec0302d1c Publicly expose Torrent.GotInfo 2015-04-28 15:24:17 +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