Allow multiple sub sections for tcp/udp server

This commit is contained in:
Tim David Saxen 2018-11-29 09:20:39 +01:00 committed by GitHub
parent ea2e44dc7e
commit b827fbcb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,7 +113,7 @@ func UnmarshalServerConfFromIni(defaultCfg *ServerSectionConf, content string) (
conf, err := ini.Load(strings.NewReader(content)) conf, err := ini.Load(strings.NewReader(content))
if err != nil { if err != nil {
err = fmt.Errorf("parse ini file error: %v", err) err = fmt.Errorf("parse ini conf file error: %v", err)
return nil, err return nil, err
} }
@ -129,7 +129,7 @@ func UnmarshalServerConfFromIni(defaultCfg *ServerSectionConf, content string) (
if tmpStr, ok = conf.Get("common", "bind_port"); ok { if tmpStr, ok = conf.Get("common", "bind_port"); ok {
if v, err = strconv.ParseInt(tmpStr, 10, 64); err != nil { if v, err = strconv.ParseInt(tmpStr, 10, 64); err != nil {
err = fmt.Errorf("parse conf error: invalid bind_port") err = fmt.Errorf("Parse conf error: invalid bind_port")
return return
} else { } else {
cfg.BindPort = int(v) cfg.BindPort = int(v)