Commit Graph

620 Commits

Author SHA1 Message Date
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 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 48c3df2d43 Refactorings 2016-01-05 11:48:16 +03:00
Gleb Sinyavsky 8637086ef9 Merge branch 'master' of https://github.com/anacrolix/torrent 2016-01-04 15:39:08 +03:00
Matt Joiner 09050ff2c5 Some missing hunks that fix build 2016-01-04 22:56:36 +11:00
Matt Joiner 3208fac438 Failure to announce on one tracker isn't very interesting 2016-01-04 22:54:19 +11:00
Matt Joiner 3c446086af Add Have and Bitfield connection methods 2016-01-04 22:37:49 +11:00
Matt Joiner 8346ff81f7 Switch to int from peer_protocol.Integer for piece index in a lot of places 2016-01-04 22:34:24 +11:00
Gleb Sinyavsky be8e44da3c peersKey is a public type now 2015-12-27 15:27:32 +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 f9a04b4f29 Suppress log message regarding bad tracker URLs 2015-12-23 03:32:24 +11:00
Matt Joiner 86c4c609f1 Expose Torrent.SetDisplayName 2015-12-12 14:03:04 +11:00
Matt Joiner 672e3c4136 Don't consider a peer to have touched a piece if a chunk isn't written successfully
This prevents peers being banned when there are issues with the data service locally.
2015-12-11 03:04:04 +11:00
Matt Joiner 79eb1ca0d5 torrent.DisplayName should not be exported 2015-11-22 18:44:08 +11:00
Matt Joiner 9f38d212e4 Blocking IPv6 addresses is not so interesting 2015-11-13 22:33:50 +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 f8fb480817 Avoid copying mutex in piece 2015-10-30 01:16:52 +11:00
Matt Joiner a4049e179c Avoid allocation in iplist.Ranger.Lookup
It was very expensive for DHT packets.
2015-10-19 00:00:26 +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
Kupai József 70a307a5ea fix: added announce to torrent spec 2015-10-10 14:31:02 +02: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 58c997210e Track peer sources with a dict, and don't exceed high water mark 2015-09-28 15:30:13 +10:00
Matt Joiner 53259397fc Initialize connection piece priorities lazily, and using a pool 2015-09-26 17:27:35 +10:00
Matt Joiner 22428da0e3 Add packed IP list
This saves a lot of memory by allowing the IP blocklist to be mmap()ed in. In production with the latest level1 blocklist it's 35MB per process.
2015-09-23 18:25:22 +10:00
Matt Joiner 0fa547e292 Don't warn about zero port peers from trackers 2015-09-20 21:09:10 +10:00
Matt Joiner cd96dbcd9d Tidy 2015-09-17 12:54:03 +10:00
Matt Joiner 11d703fbf1 Count failed chunk sends against a connection 2015-09-17 12:50:29 +10:00
Matt Joiner 9f324d04e2 Tweak logging 2015-09-17 12:40:35 +10:00
Matt Joiner 0113776f1d Reduce noise about zero port peers 2015-09-17 12:39:51 +10:00
Matt Joiner 313adf1d2f Some code missed in the last commit ಠ_ಠ 2015-09-06 12:35:56 +10:00
Matt Joiner eebd09c0fe Allow subscribing to torrent piece state changes 2015-09-06 12:33:22 +10:00
Matt Joiner 4472a0e27a Add Debug flag to Config
I'll use this to squash the noisy logging for people who don't care.
2015-08-23 12:59:03 +10:00
Matt Joiner 698181e470 Code comment 2015-08-23 12:49:35 +10:00
Matt Joiner 1db00a54f0 Redo the compact peer types 2015-08-17 19:52:47 +10:00
Matt Joiner 6b27e1473d Upload after a piece completes 2015-08-12 17:11:14 +10:00
Matt Joiner 6c8c870b28 Log zero ports from trackers 2015-08-06 08:58:13 +10:00
Matt Joiner cb00308157 Back off on the kicked connections log 2015-08-06 08:56:36 +10:00
Matt Joiner 59e50bd614 Log who's giving us zero ports over PEX
In the long run this will help determine why this happens.
2015-08-06 08:55:48 +10:00
Matt Joiner 5d5ee66be4 Clear piece touch flag from connection after a piece is hashed 2015-08-05 02:43:53 +10:00
Matt Joiner 497d185373 Add an option to disable IPv6 2015-08-05 02:41:50 +10:00
Matt Joiner 085be622a0 Replacing pendingWrites WaitGroup with Mutex/Cond/int
Apparently I've been using WaitGroups wrong all along.
2015-08-05 02:40:46 +10:00
Matt Joiner 92e1e505b4 Improve log message 2015-08-04 01:33:50 +10:00
Matt Joiner da8ac9fe01 Log errant unwanted piece rather than panic
Eventually I'll work out what causes this, but for now it's incredibly rare.
2015-08-04 01:29:40 +10:00
Matt Joiner bbe58bbd73 Filter out DHT peers with port 0
Probably not necessary now we ban the nodes that send them, but it's appropriate to check here too.
2015-08-04 01:20:10 +10:00
Matt Joiner f3317322f8 Fix crash if peer sends out of bounds HAVE message 2015-08-04 01:17:32 +10:00
Matt Joiner f69c51bea3 Tighten up some potential leaks
Based on some observations of lingering goroutines in unit tests.
2015-08-04 01:15:09 +10:00
Matt Joiner 54339a30e3 Drop connections that contributed to pieces that failed to hash
There are peers out there that seem to intentionally spam bad data, and the same pieces will often fail continuously. This really puts a bee in their bonnet.
2015-08-04 01:12:09 +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 f9995244c0 If a DHTConfig was provided without a blocklist, the DHT wouldn't inherit the Client's blocklist 2015-08-04 00:43:46 +10:00
Matt Joiner 68e3b9f666 dht: Block bad nodes, start by banning those that send port=0 2015-08-04 00:31:53 +10:00
Matt Joiner 1f008fb4f0 Trivial missed changes 2015-08-02 21:00:49 +10:00
Matt Joiner 06dede5690 Track the connection flags for completed handshakes 2015-08-02 04:06:22 +10:00
Matt Joiner 34d3d7aca0 Tidy up outbound connection code
Preparing to allow alternate dialing logic.
2015-08-02 04:04:42 +10:00
Matt Joiner d037e6ee9c Suppress a lot of noisy logging 2015-08-02 04:01:41 +10:00
Matt Joiner e5acfcbb46 Comments 2015-08-02 03:53:37 +10:00
Matt Joiner 8ce61e911d Torrent.BytesCompleted was racy 2015-07-21 22:54:02 +10:00
Matt Joiner 78ec88ad02 Don't probe pieces when setting torrent storage
It blocks the caller, for potentially quite some time. I've tested without this for some time now.
2015-07-21 22:52:43 +10:00
Matt Joiner 346c457e9c Hashing was blocking prioritization of pieces 2015-07-21 22:51:15 +10:00
Matt Joiner 84fc3aab0f client.go: Missing perf import 2015-07-17 21:45:44 +10:00
Matt Joiner 0600c3b5e3 Several speedups in logic 2015-07-17 21:07:01 +10:00
Matt Joiner 6c04000644 Downloading a chunk may mean the piece isn't wanted anymore
Hopefully this fixes a very rare logic error in replenishing connection requests for a piece that isn't wanted, yet is still in the connection piece request order.
2015-07-17 21:04:43 +10:00
Matt Joiner 7e9fe4f447 Store chunk data without holding client lock 2015-07-15 16:00:59 +10:00
Matt Joiner c018c660f0 Allow chunk size to be specified per torrent 2015-07-15 15:31:18 +10:00
Matt Joiner 4807f12ea1 When seeding, actually seed beyond 6 chunks 2015-07-15 15:29:53 +10:00
Matt Joiner 08f89c49f3 Don't raise piece priority while hashing or if piece complete 2015-07-04 13:38:42 +10:00
Matt Joiner fd2824f595 Raise socketsPerTorrent to 80 2015-06-30 00:46:43 +10:00
Matt Joiner bb28ff7492 Replace pruning timer with as-required connection dropping 2015-06-30 00:45:26 +10:00
Matt Joiner 1595f65ac2 Adjust some expvars 2015-06-30 00:35:47 +10:00
Matt Joiner 2277e16dca Rename and sort some of the expvars 2015-06-28 16:41:51 +10:00
Matt Joiner dd34efad57 Comments and update version strings 2015-06-28 16:40:46 +10:00
Matt Joiner 4f293ca75b Several trivial fixes 2015-06-28 16:39:04 +10:00
Matt Joiner 4b6c8b1c39 Move methods to correct file 2015-06-23 02:02:22 +10:00
Matt Joiner b5ee4f602d Document ConfigDir 2015-06-22 19:48:50 +10:00
Matt Joiner ad6fec2e77 Clarify downloaded chunk counters 2015-06-22 19:48:30 +10:00
Matt Joiner 859129fb28 Print peer IDs as escaped ascii 2015-06-22 19:46:26 +10:00
Matt Joiner 99a06e3f50 Move IP blocklist loading into iplist package 2015-06-22 19:44:59 +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 764f5db512 Make readahead always at least 2 blocks. 2015-06-16 16:54:12 +10:00
Matt Joiner d63c5e5b98 Don't try to connect again without encryption, if encryption is disabled 2015-06-08 18:16:01 +10:00
Matt Joiner 5014b62e17 Reduce log noise due to uTP connection timeouts 2015-06-03 22:44:03 +10:00
Matt Joiner 005ca8124a Fix rare single-torrent stall due to obsolete ceaseNetworking call
Only occurred if you have a data backend that can drop completed pieces, and it happened that you wanted to redownload data that had been dropped after completely downloading the torrent in the past.
2015-06-03 22:43:40 +10:00
Matt Joiner 7e8ee950bc Docs and comments 2015-06-03 13:30:55 +10:00
Matt Joiner a2df9f8b01 Miscellaneous changes 2015-06-03 00:03:43 +10:00
Matt Joiner 5de6abd6a7 Fix race to set IPBlocklist on DHT before it bootstraps and serves 2015-06-02 23:58:49 +10:00
Matt Joiner 5b52769523 Changes to the way piece prioritization affects the piece 2015-06-01 18:23:35 +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 bc4aa06c91 Comments 2015-06-01 18:17:14 +10:00
Matt Joiner 7f9d6eed78 Relax pedantic listen addr matching
Fixes #15.
2015-05-20 18:14:42 +10:00
Matt Joiner 085dbaa8ff Include reason for panic on different listener addresses 2015-05-20 15:45:58 +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 0d13293d71 Support seeding 2015-05-15 08:39:53 +10:00
Matt Joiner 5eb6b5286e Rare panic: a piece is requested that shouldn't have been 2015-05-09 11:52:52 +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 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Matt Joiner cc6a52fee0 Remove all the old intermediate config fields from Client 2015-04-27 14:05:27 +10:00
Matt Joiner b37f6d6f96 Add the option to disable encryption 2015-04-20 17:30:22 +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 97c235440c If IP blocklists are enabled, block anything that isn't IPv4
I know of no public IPv6 blocklists.
2015-04-01 17:36:51 +11:00
Matt Joiner 6b81d57ca2 dht: Clean-up interface, add loads of documentation 2015-04-01 17:29:55 +11:00
Matt Joiner 6c3f8ea26c Remove unnecessary reflection 2015-04-01 14:34:57 +11:00
Matt Joiner 8ba4a2e0f3 cmd/torrentfs: Check error creating client
This wouldn't have happened with exceptions ;)
2015-04-01 14:30:22 +11:00
Matt Joiner c202e2289c Opinionated torrent filter doesn't belong in this package 2015-03-30 23:11:20 +11:00
Matt Joiner 1ce84f664e Fix a few minor data races 2015-03-30 23:10:37 +11:00
Matt Joiner 5ecde3a874 Show number of torrents in the client status 2015-03-28 02:51:16 +11: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 90b27618ac The signedness on several tracker.AnnounceRequest fields now matters
Sending negative ports and lefts through to HTTP trackers was making them mad.
2015-03-27 17:22:00 +11:00
Matt Joiner 8ae09e2fa8 Only the first tracker was being tried
Must have lost this in the client tracker clean-up a while back.
2015-03-27 17:20:02 +11:00
Matt Joiner 64f833f3f0 cmd/torrent-magnet: Converts a torrent from stdin to a magnet link 2015-03-27 17:16:50 +11:00
Matt Joiner 5049f5d375 More unnecessary log shushing 2015-03-27 15:37:58 +11:00
Matt Joiner 60d8ea75a2 Prevent bad metadata_size in extended handshakes from stalling completion of metadata
Occasionally bad peers send ridiculous or incorrect metadata_size in their handshakes. If the first acceptable size is wrong, and too small, we'll keep failing metadata completion. If it's too large, honest peers will never send us the pieces we're asking for and we'll never complete the metadata. Now we just adjust the expected metadata size, and keep retrying until we finish. Additionally, we can now request metadata after sending initial messages.
2015-03-27 15:36:59 +11:00
Matt Joiner 5f7ad4c769 Merge all the tracker packages, why would anyone want them separately? 2015-03-27 15:12:15 +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 d97b487229 cmd/torrent: Report progress
Fixes #6
2015-03-25 17:32:42 +11:00
Matt Joiner c471613cd0 Suppress some noisy errors that aren't interesting to the average user 2015-03-25 17:28:34 +11:00
Matt Joiner 6da805d1b1 Move ut_pex back into the "m" map 2015-03-25 15:49:27 +11:00
Matt Joiner 19a50712dc Add the ability to disable PEX
Fixes #3
2015-03-25 15:42:14 +11:00
Peter Borzov f574117e30 Fix typos 2015-03-21 09:11:45 -04:00
Matt Joiner 67f90ed886 More public interface tidying 2015-03-20 23:52:53 +11:00
Matt Joiner ec25ef417e bitbucket.org/anacrolix/sync moved to github 2015-03-20 16:46:39 +11:00
Matt Joiner 842a32ae0c Rewrite import paths for migration from Bitbucket 2015-03-20 16:37:44 +11:00
Matt Joiner 0c63952353 More cleaning up of public interface 2015-03-20 10:52:01 +11:00
Matt Joiner a646308a12 Update the example 2015-03-20 10:51:06 +11:00
Matt Joiner a07eb8d720 Misc, some encryption related 2015-03-18 18:37:26 +11:00
Matt Joiner f90e6e7c2c Don't accept unless connections are wanted 2015-03-18 18:36:27 +11:00
Matt Joiner c413ed7963 Comments in banned torrent list 2015-03-18 18:35:52 +11:00
Matt Joiner a451bc7e6d Handle data going missing 2015-03-18 18:35:22 +11:00
Matt Joiner 29238ff23f Change the interface to add torrents to a Client 2015-03-18 18:32:31 +11:00
Matt Joiner 58b2b9bec7 Avoid dopplegangers, foreign address that have our client ID 2015-03-18 18:29:51 +11:00
Matt Joiner a7dddd9be6 Rewrite handshaking and connection management 2015-03-18 18:28:13 +11:00
Matt Joiner fa025bdbee Disable AllowedFast 2015-03-18 18:21:00 +11:00
Matt Joiner 203da0aab0 Tidy up extension bytes handling; don't close conn from handshake writer; force protocol encryption for now 2015-03-13 06:21:13 +11:00
Matt Joiner e85b7e228b Add support for Fast Extension 2015-03-12 20:06:23 +11:00
Matt Joiner 339c650085 Count peers obtained by tracker 2015-03-12 20:04:44 +11:00
Matt Joiner 26b21d1fcb Apply IP blocklist to trackers 2015-03-11 02:41:41 +11:00
Matt Joiner e6fbde0dc6 Rework piece completion 2015-03-11 02:41:21 +11:00
Matt Joiner 914bc12bb6 Harmless improvements 2015-03-11 02:39:01 +11:00
Matt Joiner 36c6283a94 Fix a status line going to stdout 2015-03-09 17:35:51 +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 cad611bbcf Since IPv6 blocklists aren't prevalent, default to using IPv4 in client for now 2015-03-07 17:11:02 +11:00
Matt Joiner 1c5bd1855a Improvements to P2P blocklist scanning errors 2015-03-07 17:09:18 +11:00
Matt Joiner e4dec03a32 Change the way readahead pieces are calculated 2015-03-04 13:07:11 +11:00
Matt Joiner 779f4d3b97 Implement Handle.ReadAt 2015-03-04 13:06:33 +11:00
Matt Joiner 4eb70e0673 Support opening handles to Torrent and File 2015-03-01 14:32:54 +11:00
Matt Joiner a2d69b4931 Make blob data stateful 2015-02-27 12:45:55 +11:00
Matt Joiner bd6d72fa5f Files.Path and .FileInfo change 2015-02-27 01:46:40 +11:00
Matt Joiner 315c703456 Rename TorrentData->Data 2015-02-27 01:43:37 +11:00
Matt Joiner f588522b66 Client.Torrent(InfoHash) 2015-02-26 16:10:55 +11:00
Matt Joiner 3f335cabfc Implement File.ReadAt 2015-02-26 16:10:38 +11:00
Matt Joiner 9ffb9b0b88 Scale readahead pieces a bit 2015-02-26 16:10:15 +11:00
Matt Joiner c75dbccea3 Hide a whole bunch of functions seen via torrent 2015-02-25 15:42:47 +11:00
Matt Joiner 80ce2c3188 Set torrentDataOpener from config 2015-02-25 15:41:13 +11:00
Matt Joiner 295b71c09b Not listening! 2015-02-25 14:52:19 +11:00
Matt Joiner 48dc85bfd3 Return no Files if Torrent Info isn't available 2015-02-25 14:51:56 +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 61adeee308 Make IPBlockList accessible from Client 2015-02-25 11:25:22 +11:00
Matt Joiner bc940ae2c6 Remove unused code 2015-02-25 01:40:27 +11:00
Matt Joiner 9fb7934d0c Comments 2015-02-25 01:34:57 +11:00
Matt Joiner 92e0679b04 Change piece prioritization 2015-02-21 15:02:31 +11:00
Matt Joiner 2025daa77c Improve announcer routines 2015-02-21 15:02:06 +11:00
Matt Joiner e067bff5b3 Comments 2015-02-21 14:58:28 +11:00
Matt Joiner c3457b2f54 Change status output 2015-02-21 14:57:37 +11:00
Matt Joiner 763f238492 Tweak handshaking and peer water marks 2015-02-21 14:56:17 +11:00
Matt Joiner 94c01fb565 defer Unlock 2015-02-10 00:21:50 +11:00
Matt Joiner de71611752 Add File.Progress 2015-02-10 00:18:59 +11:00
Matt Joiner 467d2bdf8d Handle SetDeadline failure for handshake 2015-02-10 00:17:59 +11:00
Matt Joiner 3c9fdba345 uTP raw Socket use is now via .PacketConn 2015-02-10 00:17:04 +11:00
Matt Joiner a1010d7404 Misc tidying 2015-02-10 00:16:01 +11:00
Matt Joiner 029d6939f8 Hide some methods that shouldn't be public 2015-02-10 00:12:29 +11:00
Matt Joiner 4ca6b4e2c7 Fix some stuff Rob Clifford broke through stress testing 2015-02-06 14:54:59 +11:00
Matt Joiner 8e95c1a0ac Log addr when dials fail for unexpected reason 2015-01-31 01:54:45 +11:00
Matt Joiner 4cf28bf0e9 Deduplicate iplist range descriptions, saves another 2.8MB heap 2015-01-31 01:53:42 +11:00
Matt Joiner c6cc38c9cf iplist: Make range descriptions copies of substring, saves 8MB heap on level1 blocklist! 2015-01-31 01:53:01 +11:00
Matt Joiner 336495c25b connectionPruner should terminate when the torrent stops 2015-01-29 14:21:05 +11:00
Matt Joiner b3380f1cee dht: Provide Announce, that combines get_peers and announce_peer 2015-01-29 14:20:21 +11:00
Matt Joiner 04e5880d09 Comments 2015-01-29 14:17:27 +11:00
Matt Joiner 83b9135554 Expose Files from Torrent 2015-01-28 01:12:36 +11:00
Matt Joiner 9995470fe6 Improve returned error 2015-01-22 00:42:13 +11:00
Matt Joiner 78caa4533b Scale readahead with unchoked connections 2015-01-11 00:16:57 +11:00
Matt Joiner ce3fd07fde Set Client.utpSock 2015-01-11 00:16:19 +11:00
Matt Joiner 39b9eb1d37 Switch to my own UTP library 2015-01-08 23:26:39 +11:00
Matt Joiner 0810d5a275 Helper method on Client's Torrent that tells where the metainfo file would be stored 2014-12-30 23:58:38 +11:00
Matt Joiner 7e6b3b24e3 Catch a few possible connection leaks 2014-12-26 17:18:36 +11:00
Matt Joiner cc5dea6a39 Reenable UTP despite it being broken, some binaries now have flags to disable it 2014-12-26 17:18:15 +11:00
Matt Joiner 9b0e387ac9 Quieten tracker announce logging 2014-12-26 17:17:49 +11:00
Matt Joiner 3a221dc57d Rip out the pieces by bytes left and responsive download strategy stuff 2014-12-26 17:15:17 +11:00
Matt Joiner c817776fda Don't include active handshakes in the half open limit
Large numbers of incoming connections choke initiation of outbound conns.
2014-12-23 15:20:28 +11:00
Matt Joiner e406d74ff0 Don't guess cap for some torrent fields, need to minimize memory use 2014-12-20 13:00:21 +11:00
Matt Joiner 262f045fd1 Fixes due to not pending chunk specs prematurely 2014-12-09 00:22:05 -06:00
Matt Joiner 48582796ed Add pending peers high water mark to stop excessively long running DHT queries 2014-12-08 21:58:49 -06:00
Matt Joiner 4be7b11a3b Use bitbucket.org/anacrolix/sync 2014-12-08 17:00:38 -06:00
Matt Joiner d9793a78ba Improve announce logging 2014-12-08 16:57:42 -06:00
Matt Joiner 1e3a00979d Fix UTP still listening despite attempting to temporarily disable it 2014-12-06 21:19:56 -06:00
Matt Joiner 51306ccbb2 Expose various DHT state 2014-12-06 21:19:02 -06:00
Matt Joiner d58ca65a9c pieceordering: Rename RemovePiece->DeletePiece and complete tests
Note that tests currently fail due to bug in skiplist?
2014-12-05 00:58:04 -06:00
Matt Joiner 65ccc9c75e Forgot to commit this part of fixing disable TCP dialing out 2014-12-05 00:56:51 -06:00
Matt Joiner b6ae4caa6a Set priorities ahead of the current read position 2014-12-05 00:56:28 -06:00
Matt Joiner f050bc02f7 Disabling TCP didn't include dialing out, also always disable UTP until the package is fixed 2014-12-05 00:53:26 -06:00
Matt Joiner 7b46b41011 Switch back to using the UTP redesign 2014-12-03 19:58:02 -06:00
Matt Joiner 91c2c1f5c7 Piece priorities, torrent read interface and many fixes 2014-12-03 01:07:50 -06:00
Matt Joiner 98400ab9c7 Harmless shortcut initing peer pieces when we have the torrent info 2014-12-02 18:43:05 -06:00
Matt Joiner a87e753572 When metadata arrives, we also need to init request ordering 2014-12-02 18:42:22 -06:00
Matt Joiner 9fac3e8f33 Remove commented out code 2014-12-02 18:23:07 -06:00
Matt Joiner 7228e40c95 Add piece ordering per-connection piece request priority 2014-12-02 18:22:38 -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 e7dec6057b Backed out changeset: 603a76a6bdb0 2014-12-02 00:11:39 -06:00
Matt Joiner 351bc3e504 Update to use utp package redesign 2014-12-01 23:35:39 -06:00
Matt Joiner d599f85391 Ensure that when a cached torrent is used, the info hash is correct 2014-12-01 23:32:40 -06:00
Matt Joiner 0f1342d7d1 Don't clobber torrent name with empty magnet display name 2014-12-01 19:12:03 -06:00
Matt Joiner 0a91eef496 For now always read ahead 4 extra blocks 2014-12-01 17:02:31 -06:00
Matt Joiner e4f1f5d55e Rework torrent adding 2014-12-01 16:40:03 -06:00
Matt Joiner 362dfecbf2 Support banning torrents 2014-12-01 16:39:09 -06:00
Matt Joiner fb2b626175 Don't send constructed MetaInfo down a channel when it's available, build it on demand 2014-12-01 16:37:40 -06:00
Matt Joiner 709650c0bd Sleep between announces in case there are no trackers 2014-12-01 12:43:34 -06:00
Matt Joiner 75cde79d65 Improve the interface with client and download strategies 2014-12-01 03:37:33 -06:00
Matt Joiner 78ef36066d Give each connection its own piece priority order 2014-12-01 03:36:25 -06:00
Matt Joiner 0a71fe4bee Fast start torrent tracker announces 2014-12-01 03:33:52 -06:00
Matt Joiner 76f83e60b2 Misc good fixes 2014-12-01 03:32:17 -06:00
Matt Joiner 54ea32ddc4 Block IPv6 for now 2014-12-01 03:27:11 -06:00
Matt Joiner 336715874f Fix race reordering tracker tier 2014-11-29 20:33:45 -06:00
Matt Joiner d68664d6c8 Some changes to block list handling 2014-11-29 20:33:17 -06:00
Matt Joiner 0eb36e76ef A few tweaks 2014-11-28 19:42:18 -06:00
Matt Joiner 17a8b8aa17 Make use of IP blocklist and change the client lock to RWMutex
The blocklist is loaded through from the file at TORRENT_BLOCKLIST_FILE or
$HOME/.config/torrent/blocklist.
2014-11-28 19:41:53 -06:00
Matt Joiner 50e3db173f Allow DHT server config to be passed through when creating a new client 2014-11-28 12:13:08 -06:00
Matt Joiner c10fbb2022 Extra time between tracker announces 2014-11-28 08:39:13 -06:00
Matt Joiner 1527321c71 Wasn't actually copying the tiers
http://stackoverflow.com/questions/27055626/concisely-deep-copy-a-slice
2014-11-21 00:54:19 -06:00
Matt Joiner 97074dc060 Improve tracker connect error log message 2014-11-21 00:32:39 -06:00
Matt Joiner 4725a70875 Shuffle tracker tiers after adding trackers 2014-11-21 00:32:27 -06:00
Matt Joiner 1a401e82f5 Merge trackers by magnet links if the torrent is already present 2014-11-21 00:10:52 -06:00
Matt Joiner 06aff91f8c Don't open new connections or announce when new connections aren't wanted 2014-11-21 00:09:55 -06:00
Matt Joiner 1942d5b73b Fix default torrent client address, and leaked resources 2014-11-21 00:07:04 -06:00
Matt Joiner c57ea76b88 Support disabling UTP 2014-11-19 20:02:20 -06:00
Matt Joiner dd240b66c4 Simple connection pruner 2014-11-18 22:03:21 -06:00
Matt Joiner eacc624115 Expose a Torrent "handle", that implements ReaderAt 2014-11-18 21:58:36 -06:00
Matt Joiner c8327a8fe2 Log bad metadata packets instead of crashing 2014-11-18 21:57:27 -06:00
Matt Joiner 3dd43c6099 buffer WriteStatus and always write torrents in the same order 2014-11-18 21:56:50 -06:00
Matt Joiner 358f089515 Set a minimum dial timeout 2014-11-18 21:53:00 -06:00
Matt Joiner 1057ac8055 Adding a duplicate magnet returns the existing torrent 2014-11-18 14:34:13 -06:00
Matt Joiner 482dde8e3f Fix race condition calculating reduced dial timeout 2014-11-18 14:33:07 -06:00
Matt Joiner c63d36c1b6 Improve client status write-out 2014-11-18 14:32:51 -06:00
Matt Joiner abfa44d6e4 Count accepted connections 2014-11-18 14:31:47 -06:00
Matt Joiner 541f11aed4 Ensure the parallel dial invariant 2014-11-17 18:04:33 -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