Commit Graph

133 Commits

Author SHA1 Message Date
Matt Joiner 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Milos Gajdos bdaeaf80c9 Added BootstrapNodes to dht.ServerConfig
This is beneficial to users who are running their own private trackers
or have outbound connections to ports 6881 disallowed on firewalls.
2015-04-02 23:35:30 +01:00
Matt Joiner 502bb455e8 dht: Remove obsolete function Server.AnnouncePeer 2015-04-01 17:38:17 +11:00
Matt Joiner 4cb3e94a91 dht: Apply blocklist to incoming packets 2015-04-01 17:37:32 +11:00
Matt Joiner 6b81d57ca2 dht: Clean-up interface, add loads of documentation 2015-04-01 17:29:55 +11:00
Matt Joiner b3a4d6c6a4 dht: Rename get_peers.go->announce.go
It has had the wrong name for a very long time.
2015-04-01 16:05:57 +11:00
Matt Joiner 44947ff52f dht: Avoid allocation(s) testing if an IP is blocked 2015-03-30 23:12:33 +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 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 a372b68abb dht: Handle responses through a callback
Trying to reduce number of goroutines
2015-02-21 15:00:48 +11:00
Matt Joiner 2b3d286e9e dht: Fix race 2015-02-10 00:21:22 +11:00
Matt Joiner 4ca6b4e2c7 Fix some stuff Rob Clifford broke through stress testing 2015-02-06 14:54:59 +11:00
Matt Joiner 9d640cd42d Use CopyExact 2015-01-29 14:21:42 +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 67b7c5adc8 dht: Reduce memory use 2015-01-22 00:41:06 +11:00
Matt Joiner c303ce09d8 Fix a few tests 2015-01-11 21:42:57 +11:00
Matt Joiner d54c5ddf24 Remove a bunch of dead code 2014-12-28 12:51:09 +11:00
Matt Joiner e0d936e920 dht: Various improvements and removal of cruft 2014-12-26 17:21:48 +11:00
Matt Joiner 59d6b67c69 dht: Fix partial deadlock closing peer discovery 2014-12-20 13:02:12 +11:00
Matt Joiner dbf72c1033 dht: Some peer sent me a bad info_hash 2014-12-20 10:10:53 +11:00
Matt Joiner ec47c4f4dc dht: Use a bloom filter to track contacted nodes during peer discovery 2014-12-20 10:10:22 +11:00
Matt Joiner 20d4549430 dht: Use both bootstrap addrs, as they seem to take turns going down 2014-12-20 10:09:11 +11:00
Matt Joiner b52f866e90 dht: We can now message nodes with no ID if there's nothing better 2014-12-09 00:25:49 -06:00
Matt Joiner f513772f1f dht: Slow down the start a little, as lots of torrents will hammer out UDP packets 2014-12-09 00:24:05 -06:00
Matt Joiner fa501ed06a dht: Limit the size of peer discovery backlog 2014-12-08 21:57:53 -06:00
Matt Joiner e926a8d65c dht: During get_peers, put discovered nodes in a backlog for later querying 2014-12-08 20:00:42 -06:00
Matt Joiner d1bcb272bc dht: A few minor improvements 2014-12-08 19:14:10 -06:00
Matt Joiner 78eb25535d dht: Cap nodes to 10k, drop nodes that timeout if we're out of space 2014-12-08 19:09:11 -06:00
Matt Joiner ac57158982 dht: Store transactions by key, and fix partial deadlock 2014-12-08 16:59:25 -06:00
Matt Joiner c6d41cf027 dht: Tidy up GetPeers() 2014-12-06 21:22:12 -06:00
Matt Joiner 35ba3c44e1 dht: Retry queries twice before timing out 2014-12-06 21:21:20 -06:00
Matt Joiner 51306ccbb2 Expose various DHT state 2014-12-06 21:19:02 -06:00
Matt Joiner 948de5629b dht: Seemed to be wasting a lot of memory here 2014-12-03 01:08:18 -06:00
Matt Joiner ea88bad291 dht: Don't log messages that have been truncated 2014-12-02 18:43:28 -06:00
Matt Joiner d2f8114154 dht: Receiving UDP source port 0 isn't an error apparently 2014-12-02 14:55:41 -06:00
Matt Joiner 2668a2f1cc dht: Don't log messages that fail to decode on the first byte 2014-12-01 19:12:26 -06:00
Matt Joiner fec0ac6ea5 dht: Improve bad KRPC message screening 2014-12-01 17:01:55 -06:00
Matt Joiner b1da5d0656 Log the type for a rare DHT crash 2014-12-01 03:29:06 -06:00
Matt Joiner 69969d0d73 dht: Error while sending a find_node during bootstrap is not fatal 2014-11-29 20:31:07 -06:00
Matt Joiner a1d81abb0d router.bittorrent.com is in the level1 blocklist so use the alternative bootstrap addr 2014-11-28 19:45:12 -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 1c78c81075 Add a passive flag for DHT, that disables responding to queries 2014-11-28 12:04:38 -06:00
Matt Joiner 2a8a86734b dht: Reduce allocations in calculating ID distance 2014-11-19 20:02:03 -06:00
Matt Joiner a87566b9f6 dht: Handle truncated KRPC packets better, requires an update to bencode package 2014-11-18 21:54:53 -06:00
Matt Joiner a8c49a2a83 dht: Improve Server.GetPeers so new nodes are fed directly back into the current discovery 2014-11-18 12:38:13 -06:00
Matt Joiner d7764a5c23 dht: Reduce announce peer parallelism now that node goodness is fixed 2014-11-17 18:03:28 -06:00
Matt Joiner a14f38a21c dht: Move packet processing into a separate function 2014-11-17 18:03:03 -06:00
Matt Joiner e4822769ee dht: Fix "good" node determination 2014-11-17 18:02:16 -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 02160eb8bc Expose DHT ID distances as an interface and switch to big.Int and possibly the correct algorithm 2014-11-17 01:47:24 -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 5bf56f6d8d Tunnel addrs through dht as an internal interface to make switching easier 2014-11-16 21:22:29 -06:00
Matt Joiner 34a47a100e Add util AddrIP and AddrPort functions 2014-11-16 21:20:49 -06:00
Matt Joiner 1460e835c2 Add dht AnnouncePeer 2014-11-16 13:08:33 -06:00
Matt Joiner d17a2958a6 dht.Server.Ping didn't lock structure 2014-08-25 22:14:31 +10:00
Matt Joiner 2d9c22ae1e Misc trivial improvements 2014-08-25 22:14:10 +10:00
Matt Joiner 3e26952f2f Improve DHT distance tests 2014-08-22 03:45:31 +10:00
Matt Joiner 4a7c94d04d Add test for dht.NewServer and change StopServing to Close 2014-08-21 21:12:50 +10:00
Matt Joiner 40fd1d647c Tidy up the torrent and DHT APIs 2014-08-21 18:07:06 +10:00
Matt Joiner cd7a758acd dht: Message only the most likely peers 2014-07-24 13:45:18 +10:00
Matt Joiner efb4c557d2 Put checks in place for peer addresses with a zero Port 2014-07-18 02:38:11 +10:00
Matt Joiner 9c575b0454 dht_test: Add commented out test I haven't resolved yet 2014-07-17 16:05:21 +10:00
Matt Joiner 99bec9ac58 dht: Timeout goroutines waiting for transaction responses 2014-07-17 16:03:59 +10:00
Matt Joiner a258b9ab21 Squash some more debug messages, fix some other error handling 2014-07-17 16:01:48 +10:00
Matt Joiner 7d587b832e Squash various unhandled DHT messages 2014-07-16 17:10:49 +10:00
Matt Joiner e2fc96cc5a Fix crash when KRPC messages don't contain a valid "t" field 2014-07-16 17:10:17 +10:00
Matt Joiner 583d5c266a Squash some unhelpful log messages now that stuff is available in status 2014-07-16 17:08:25 +10:00
Matt Joiner 8910eb660d Add more information I've needed to the status page 2014-07-16 17:07:28 +10:00
Matt Joiner 0f8b13dc6d dht: Reply to get_peers and find_node queries 2014-07-12 01:24:01 +10:00
Matt Joiner e947ce2ee4 Run go vet on everything 2014-07-10 02:59:37 +10:00
Matt Joiner ba83f65ddf dht: Concurrency improvements and fixes to bootstrapping and getting peers 2014-07-10 00:13:54 +10:00
Matt Joiner 78fe1b11ae Implement dht-get-peers command and GetPeers method in dht package 2014-07-04 01:43:04 +10:00
Matt Joiner 49e71f9654 Begin adding magnet and ut_metadata support 2014-06-27 00:57:07 +10:00
Matt Joiner e7cb8a138b Begin implementing a K closest node algorithm 2014-06-24 23:20:49 +10:00
Matt Joiner 75e34be89d Some function doc 2014-06-24 23:20:07 +10:00
Matt Joiner f3af9bd5bc Wrap server UDP sends to ensure the node last send is updated 2014-06-24 23:19:19 +10:00
Matt Joiner 1852e5805d DHT default server ID generated using hostname and server address 2014-06-24 23:18:30 +10:00
Matt Joiner 83a02420a5 Got dht-server working nicely 2014-05-27 16:28:56 +10:00
Matt Joiner 92b77a7cae dht-server: Save and load node table between invocations 2014-05-25 23:04:55 +10:00
Matt Joiner 1b69e69461 Switch dht-server to bootstrapping 2014-05-25 21:34:29 +10:00
Matt Joiner 7c3d919cfb Begin implementing DHT 2014-05-24 16:51:56 +10:00