dht: Use passive from server config

This commit is contained in:
Matt Joiner 2015-08-18 02:11:48 +10:00
parent 3204e276f2
commit 74d3598656
1 changed files with 1 additions and 3 deletions

View File

@ -50,7 +50,6 @@ type Server struct {
nodes map[string]*node // Keyed by dHTAddr.String().
mu sync.Mutex
closed chan struct{}
passive bool // Don't respond to queries.
ipBlockList *iplist.IPList
badNodes *boom.BloomFilter
@ -139,7 +138,6 @@ func NewServer(c *ServerConfig) (s *Server, err error) {
return
}
}
s.passive = c.Passive
s.bootstrapNodes = c.BootstrapNodes
err = s.init()
if err != nil {
@ -722,7 +720,7 @@ func (s *Server) handleQuery(source dHTAddr, m Msg) {
node.SetIDFromString(args["id"].(string))
node.lastGotQuery = time.Now()
// Don't respond.
if s.passive {
if s.config.Passive {
return
}
switch m["q"] {