zettio/weave#362 - fix DNSServer initialization
removed a couple of goroutines spawns...
This commit is contained in:
1 parent
ef72d65aa4
commit
5dd475b2e5
3 files changed
+13
-20
No files matched your search
+1
-10
@@ -30,22 +30,13 @@ type DNSServer struct {
|
||||
}
|
||||
|
||||
// Creates a new DNS server with a given config
|
||||
func NewDNSServerWithConfig(config *dns.ClientConfig, zone Zone, iface *net.Interface, port int) (*DNSServer, error) {
|
||||
func NewDNSServer(config *dns.ClientConfig, zone Zone, iface *net.Interface, port int) *DNSServer {
|
||||
return &DNSServer{
|
||||
config: config,
|
||||
zone: zone,
|
||||
iface: iface,
|
||||
port: port,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Creates a new DNS server
|
||||
func NewDNSServer(zone Zone, iface *net.Interface, port int) (*DNSServer, error) {
|
||||
config, err := dns.ClientConfigFromFile("/etc/resolv.conf")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewDNSServerWithConfig(config, zone, iface, port)
|
||||
}
|
||||
|
||||
// Start the DNS server
|
||||
|
||||
Reference in new issue
Block a user