Commit Graph

149 Commits

Author SHA1 Message Date
Matt Joiner b98c1a7edc dht: Add counters for writes and write errors 2016-07-23 22:39:06 +10:00
Guillaume Douézan-Grard 4d917b059c fix bootstrap from global servers disabling 2016-06-01 03:02:21 +02:00
Matt Joiner a69044b9ea Break out KRPC stuff from dht into new package 2016-05-17 16:40:08 +10:00
Matt Joiner 95bb8a5eb3 dht.Server.query: Return nil Transaction if there's an error 2016-05-17 16:07:49 +10:00
Matt Joiner 2ca76cfea8 dht: Stop processing packet if server closes after unmarshalling 2016-05-17 16:07:03 +10:00
Matt Joiner 88d21ce627 dht: Don't contact nodes with an IP containing a leading octet of 0 2016-05-17 16:06:18 +10:00
Matt Joiner 2483c75f09 Improve dht.Transaction.SetResponseHandler comment 2016-05-17 16:04:33 +10:00
Matt Joiner b9a7cbfa14 dht: Fix race contacting starting addrs in Announce 2016-05-07 19:02:30 +10:00
Matt Joiner 1d87653738 Fix dht.Server.Announce never stopping if the starting addresses can't be contacted 2016-05-07 18:58:43 +10:00
Matt Joiner 0fd73396fd missinggo.Event changed, connection.writeOptimizer changes 2016-05-07 18:56:44 +10:00
Seth Hoenig 9f4bf70e17 refactor struct identifiers to follow conventional go names 2016-04-18 23:11:11 -05:00
Matt Joiner f83771b660 Apply ineffassign linter 2016-04-04 15:39:26 +10:00
Matt Joiner 811b460f1d dht: Use missinggo.Event for closing 2016-02-26 22:11:48 +11: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 621ec7bac4 dht: Misc trivial improvements 2016-02-23 23:52:30 +11:00
Matt Joiner 0e85ff190d go vet 2016-02-02 00:44:29 +11:00
Matt Joiner df07d93330 dht: Start timer under transaction lock
Satisfies race detector
2016-01-19 00:34:40 +11:00
Matt Joiner 9697a9371a Fix #47
Forgot to remove a non-deferred sync.Mutex.Unlock
2015-12-23 03:31:39 +11:00
Matt Joiner 4015031420 dht: announce_peer should not occur to insecure nodes
Additionally, we now announce even if a token wasn't provided. Why not.
2015-12-18 00:50:22 +11:00
Matt Joiner e8ff870994 dht: Except local network addresses from security checks 2015-12-17 23:51:50 +11:00
Matt Joiner 127fad47dd dht: Move security tests into separate file 2015-12-17 23:36:57 +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 6d8310d2df Test improvements 2015-12-16 15:16:53 +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
Matt Joiner 86b0c02eac Use testify for some tests 2015-12-16 15:06:23 +11:00
Dmitry Borzov 353e0d90ff Fix package-docstring for dht package 2015-12-08 00:14:13 +11:00
Matt Joiner 54853c11cc sortimports 2015-12-07 23:11:39 +11:00
Matt Joiner ff835db955 Actually fix #41 properly; and several big changes
bencode:
 * Handle omitempty on non-trivial types.
cmd/dht-ping:
 * Handle timeouts in ping transactions.
dht:
 * Propagate failed transaction responses properly.
 * Msg related tests are moved into their own file.
 * In some places, IPs in binary form are shorted to 4 bytes if IPv4.
2015-12-07 03:28:28 +11:00
Matt Joiner b86253c80d Fix #41 2015-12-07 02:39:00 +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 89f024a76b dht: Revive the UnmarshalGetPeersResponse test 2015-08-18 02:08:08 +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