Commit Graph

114 Commits

Author SHA1 Message Date
Matt Joiner a69044b9ea Break out KRPC stuff from dht into new package 2016-05-17 16:40:08 +10:00
Seth Hoenig 9f4bf70e17 refactor struct identifiers to follow conventional go names 2016-04-18 23:11:11 -05:00
Matt Joiner 2fa233345e dht: Rename newDHTAddr->NewAddr, and clean up the interface 2016-02-24 02:02:33 +11:00
Matt Joiner 7b0b0f9bf9 dht: Rename dHTAddr to Addr 2016-02-24 01:50:15 +11:00
Matt Joiner e8ff870994 dht: Except local network addresses from security checks 2015-12-17 23:51:50 +11:00
Matt Joiner f09c0cd2ec dht: Move security functions into new file 2015-12-17 23:22:39 +11:00
Matt Joiner 565fb20139 Add OnQuery hook, thanks to Cathal Garvey 2015-12-16 15:20:37 +11:00
Matt Joiner 44ec4d9bdb Add NodeIdHex config option 2015-12-16 15:15:59 +11:00
Matt Joiner 4798907da4 Add NoDefaultBootstrap and use it and testify in a few tests 2015-12-16 15:13:32 +11:00
Dmitry Borzov 87c9697a26 Move dht.Server defs to a separate file 2015-12-06 17:56:46 +03:00
Dmitry Borzov 1adae8cb47 Move Transaction & nodeInfo defs to dedicated files 2015-12-06 00:34:46 +03:00
Dmitry Borzov 3f228d9f3b Fix godoc strings for dht package 2015-12-05 23:40:41 +03:00
Matt Joiner fdf46e00b7 dht: Don't log KRPC unmarshal errors, there's a expvar for this 2015-11-13 22:34:29 +11:00
Matt Joiner 61798cd94c dht: Handle bad responses to get_peers 2015-10-30 01:18:29 +11:00
Matt Joiner 99a0813d88 dht: Make Msg a struct with bencode tags 2015-10-23 12:41:45 +11:00
Matt Joiner 9c200c0037 Missed in last commit 2015-10-19 00:02:42 +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 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 87bd9b5d17 dht: Use new Msg.Args helper method 2015-08-18 02:12:52 +10:00
Matt Joiner 288abb1c6b dht: Remove redundant code which caused rare crash 2015-08-18 02:12:27 +10:00
Matt Joiner 74d3598656 dht: Use passive from server config 2015-08-18 02:11:48 +10:00
Matt Joiner 3204e276f2 dht: Improve on on Msg methods 2015-08-18 02:11:09 +10:00
Matt Joiner b536975580 dht: BEP43 2015-08-18 02:09:10 +10:00
Matt Joiner 1db00a54f0 Redo the compact peer types 2015-08-17 19:52:47 +10:00
Matt Joiner 31acbac207 Several bad KRPC message are crying wolf 2015-08-06 09:02:50 +10:00
Matt Joiner a7c374cff7 dht: Short circuit non-DHT traffic 2015-08-06 08:59:30 +10:00
Matt Joiner a0cdda16a4 dht: Expose SecureNodeId and NodeIdSecure 2015-08-05 02:37:43 +10:00
Matt Joiner 5a73f73d97 dht: Count announce errors, don't log them 2015-08-04 01:20:44 +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 6afaa816bf dht: Add PublicIP to config to secure node ID 2015-08-04 00:37:16 +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 d077fed72d Some utils moved to missinggo 2015-08-04 00:29:01 +10:00
Matt Joiner c41aa941f3 dht: Export some useful variables 2015-06-29 19:36:08 +10:00
Matt Joiner 4a8ba4faaf dht: Suppress error during bootstrapping because Server already closed 2015-06-29 19:34:42 +10:00
Matt Joiner 4f293ca75b Several trivial fixes 2015-06-28 16:39:04 +10:00
Matt Joiner a6b5ac60ad Fix rare crash due to bad DHT node IDs 2015-06-08 18:16:29 +10:00
Matt Joiner 71f5a1882a Fix a few data races 2015-06-03 00:00:25 +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 83685f2a4b dht: Improve behaviour when adding new root nodes 2015-05-20 22:26:33 +10:00
Matt Joiner f42e27319f dht: Use maxNodes hint in node table size 2015-05-20 22:24:39 +10:00
Matt Joiner b706150607 dht: Implement the DHT security extension 2015-05-20 22:23:50 +10:00
Matt Joiner c5208569ca Apply sortimports 2015-04-30 00:31:34 +10:00
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 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