mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
cleanup
This commit is contained in:
parent
5f2bcaa71f
commit
c60dd42baa
2 changed files with 5 additions and 30 deletions
|
@ -113,22 +113,8 @@ func (t *tcp) init(l *links) error {
|
|||
if err != nil {
|
||||
t.links.core.log.Errorln("Failed to parse listener: listener", listenaddr, "is not correctly formatted, ignoring")
|
||||
}
|
||||
var metric uint8 // TODO parse from url
|
||||
if ms := u.Query()["metric"]; len(ms) == 1 {
|
||||
m64, _ := strconv.ParseUint(ms[0], 10, 8)
|
||||
metric = uint8(m64)
|
||||
}
|
||||
switch u.Scheme {
|
||||
case "tcp":
|
||||
if _, err := t.listen(u.Host, nil, metric); err != nil {
|
||||
return err
|
||||
}
|
||||
case "tls":
|
||||
if _, err := t.listen(u.Host, t.tls.forListener, metric); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
t.links.core.log.Errorln("Failed to add listener: listener", u.String(), "is not correctly formatted, ignoring")
|
||||
if _, err := t.listenURL(u, ""); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue