mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-07-10 15:57:51 +07:00
Better error handling in goroutines (#122)
* More robust goroutine error handling using channels * Fix tests and make startup log msg saner * Clarification to README and config file
This commit is contained in:
9
util.go
9
util.go
@ -10,7 +10,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/miekg/dns"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -108,14 +107,6 @@ func setupLogging(format string, level string) {
|
||||
// TODO: file logging
|
||||
}
|
||||
|
||||
func startDNS(listen string, proto string) *dns.Server {
|
||||
// DNS server part
|
||||
dns.HandleFunc(".", handleRequest)
|
||||
server := &dns.Server{Addr: listen, Net: proto}
|
||||
go server.ListenAndServe()
|
||||
return server
|
||||
}
|
||||
|
||||
func getIPListFromHeader(header string) []string {
|
||||
iplist := []string{}
|
||||
for _, v := range strings.Split(header, ",") {
|
||||
|
Reference in New Issue
Block a user