Commit Graph

308 Commits

Author SHA1 Message Date
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
Matt Joiner 6d05994c2c dht: Include the sender of peers in the peer stream 2014-11-17 17:47:36 -06:00
Matt Joiner 727aac204f Expvar successful and unsuccessful dials 2014-11-17 01:44:06 -06:00
Matt Joiner 8d96195b0c Connect to peers using both UTP and TCP; Share UTP port with DHT 2014-11-16 23:27:01 -06:00
Matt Joiner ad7cf646c8 Open new connections when a connection is dropped 2014-11-16 21:37:34 -06:00
Matt Joiner 34a47a100e Add util AddrIP and AddrPort functions 2014-11-16 21:20:49 -06:00
Matt Joiner 77e064a0f5 Allow the client ID to be set in the config 2014-11-16 13:54:43 -06:00
Matt Joiner c1721b61ef Prevent clients from connecting to other clients with the same ID 2014-11-16 13:54:00 -06:00
Matt Joiner 3489a60154 Fix broken commit 2014-11-16 13:51:59 -06:00
Matt Joiner 4fead22cd2 Use more generic net error type to detect timeouts 2014-11-16 13:31:11 -06:00
Matt Joiner e37d369864 Move half-open tracking into per-torrent 2014-11-16 13:30:44 -06:00
Matt Joiner 963918ac90 Add UTP support, disable TCP for now. DHT moves to another port 2014-11-16 13:29:31 -06:00
Matt Joiner eeae2d3285 Actually announce to DHT, don't just get peers 2014-11-16 13:18:08 -06:00