Commit Graph

446 Commits

Author SHA1 Message Date
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