From bd2844d1860e3cc07f6e30c7744ccfb35a2697d1 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 8 Jan 2015 17:15:16 +0000 Subject: [PATCH] Split http-startup code from server-startup --- nameserver/server.go | 4 +--- weavedns/main.go | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nameserver/server.go b/nameserver/server.go index 723e3483..94a0c91a 100644 --- a/nameserver/server.go +++ b/nameserver/server.go @@ -98,9 +98,7 @@ func notUsHandler() dns.HandlerFunc { } } -func StartServer(zone Zone, iface *net.Interface, dnsPort int, httpPort int, wait int) error { - go ListenHttp(LOCAL_DOMAIN, zone, httpPort) - +func StartServer(zone Zone, iface *net.Interface, dnsPort int, wait int) error { mdnsClient, err := NewMDNSClient() checkFatal(err) diff --git a/weavedns/main.go b/weavedns/main.go index d7e62b46..d00a90bc 100644 --- a/weavedns/main.go +++ b/weavedns/main.go @@ -63,7 +63,8 @@ func main() { } } - err := weavedns.StartServer(zone, iface, dnsPort, httpPort, wait) + go weavedns.ListenHttp(weavedns.LOCAL_DOMAIN, zone, httpPort) + err := weavedns.StartServer(zone, iface, dnsPort, wait) if err != nil { Error.Fatal("Failed to start server", err) }