This commit is contained in:
Simon Zolin
2020-05-25 16:29:06 +03:00
parent 2acff7757b
commit c7cc4a9345
4 changed files with 67 additions and 61 deletions

View File

@@ -72,8 +72,6 @@ func (s *Server) CheckConfig(config ServerConfig) error {
// Create - create object
func Create(config ServerConfig) *Server {
s := Server{}
config.Conf4.notify = s.onNotify
config.Conf6.notify = s.onNotify
s.conf.HTTPRegister = config.HTTPRegister
s.conf.ConfigModified = config.ConfigModified
s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename)
@@ -84,12 +82,14 @@ func Create(config ServerConfig) *Server {
}
var err error
config.Conf4.notify = s.onNotify
s.srv4, err = v4Create(config.Conf4)
if err != nil {
log.Error("%s", err)
return nil
}
config.Conf6.notify = s.onNotify
s.srv6, err = v6Create(config.Conf6)
if err != nil {
log.Error("%s", err)