|
@@ -8,6 +8,7 @@ import (
|
|
"net"
|
|
"net"
|
|
"os"
|
|
"os"
|
|
"path"
|
|
"path"
|
|
|
|
+ "runtime"
|
|
"runtime/debug"
|
|
"runtime/debug"
|
|
"sort"
|
|
"sort"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -47,6 +48,8 @@ func configReadDir(dirName string, Zones Zones) {
|
|
configLastRead[fileName] = file.ModTime()
|
|
configLastRead[fileName] = file.ModTime()
|
|
zoneName := fileName[0:strings.LastIndex(fileName, ".")]
|
|
zoneName := fileName[0:strings.LastIndex(fileName, ".")]
|
|
//log.Println("FILE:", i, file, zoneName)
|
|
//log.Println("FILE:", i, file, zoneName)
|
|
|
|
+ runtime.GC()
|
|
|
|
+
|
|
config, err := readZoneFile(zoneName, path.Join(dirName, fileName))
|
|
config, err := readZoneFile(zoneName, path.Join(dirName, fileName))
|
|
if config == nil || err != nil {
|
|
if config == nil || err != nil {
|
|
log.Println("error reading file: ", err)
|
|
log.Println("error reading file: ", err)
|
|
@@ -54,6 +57,7 @@ func configReadDir(dirName string, Zones Zones) {
|
|
if config != nil && err == nil {
|
|
if config != nil && err == nil {
|
|
Zones[zoneName] = config
|
|
Zones[zoneName] = config
|
|
dns.HandleFunc(zoneName, setupServerFunc(config))
|
|
dns.HandleFunc(zoneName, setupServerFunc(config))
|
|
|
|
+ runtime.GC()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|