Commit Graph

183 Commits

Author SHA1 Message Date
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
Matt Joiner 86de81fba8 Tidy up address handling 2014-11-16 13:16:26 -06:00
Matt Joiner ecf2639856 Add magnet-metainfo, tool to download magnet to torrent file 2014-09-25 18:05:52 +10:00
Matt Joiner 6942eed15f Lazily hash pieces where possible 2014-09-15 03:25:53 +10:00
Matt Joiner 7eaef48f9e Fix crash when piece hash completes for dropped torrent 2014-09-14 04:07:05 +10:00
Matt Joiner 1cfd6ecdcb Improvements arising from attempting to delay piece hashing until necessary 2014-09-14 04:03:23 +10:00
Matt Joiner 979192cbfd Treat PORT messages with port of 0 to mean on the remote port 2014-09-14 03:59:31 +10:00
Matt Joiner bea5c1a502 Missed this dataRead call in an earlier commit 2014-09-14 03:58:13 +10:00
Matt Joiner dc2b622be1 Track failed piece hashes 2014-09-14 03:57:51 +10:00
Matt Joiner 97ae59dfaf Improve the data waiter system 2014-09-14 03:50:15 +10:00
Matt Joiner 4bcfdc8fc9 Suppress metadata extension message errors from Xunlei client 2014-09-14 03:47:47 +10:00
Matt Joiner f2bb5b1c56 Increase peer connection buffer size from default (4096) to 20KiB
This reduces syscall overhead which becoming noticeable.
2014-09-14 03:47:06 +10:00
Matt Joiner 7fccb77ebe Treat ECONNRESET and i/o timeout from peers as EOF 2014-09-14 03:45:38 +10:00
Matt Joiner c0d7b2fbf2 Rename and improve downloaded chunk counters and status per connection 2014-09-11 20:30:13 +10:00
Matt Joiner 2b360b641c Don't log extension message parsing errors from -SD0100- 2014-09-11 14:20:47 +10:00
Matt Joiner 689fe85134 Disable TCP linger for peer connections 2014-08-28 10:06:57 +10:00
Matt Joiner ed08bd2837 Introduce socket/torrent limits, work in progress 2014-08-28 10:06:36 +10:00
Matt Joiner d5a2bc67f7 Misc tweaks 2014-08-28 10:05:41 +10:00
Matt Joiner e09e21fab2 Fixes to closing torrents and connections 2014-08-28 10:04:44 +10:00
Matt Joiner 7e19c9c12b Forgot to commit duplicateConnsAvoided expvar 2014-08-28 09:45:58 +10:00
Matt Joiner e79f1bcbf7 Keep track of ongoing handshakes and add timeouts to connection sockets 2014-08-28 09:45:20 +10:00
Matt Joiner c33b889b5e Cease networking on a torrent if it's finished and we're not going to seed 2014-08-28 09:39:27 +10:00
Matt Joiner 2765ad04ca Avoid connecting to the same peer twice by address 2014-08-28 09:35:13 +10:00
Matt Joiner aeee372506 Add useful new metrics to connection 2014-08-28 09:32:49 +10:00
Matt Joiner 035edbaf85 Rename connection.closed->closing 2014-08-28 09:31:05 +10:00
Matt Joiner 2d9c22ae1e Misc trivial improvements 2014-08-25 22:14:10 +10:00