mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-30 07:05:06 +03:00
Slight rearrangement of TXT handling
This commit is contained in:
parent
a642c6009f
commit
658a7c6948
1 changed files with 7 additions and 5 deletions
|
@ -404,12 +404,14 @@ func (c *Core) resolvePeerEntry(uri, sintf string) (peerEntry, error) {
|
||||||
if records, err := net.LookupTXT(recordname); err == nil {
|
if records, err := net.LookupTXT(recordname); err == nil {
|
||||||
for _, record := range records {
|
for _, record := range records {
|
||||||
c.log.Traceln("Found TXT record:", record)
|
c.log.Traceln("Found TXT record:", record)
|
||||||
if !strings.HasPrefix(record, "txt://") {
|
if strings.HasPrefix(record, "txt://") {
|
||||||
return peerEntry{
|
// Prevents an infinite loop
|
||||||
uri: fmt.Sprintf("%s", record),
|
continue
|
||||||
sintf: sintf,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
return peerEntry{
|
||||||
|
uri: fmt.Sprintf("%s", record),
|
||||||
|
sintf: sintf,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
c.log.Debugln("TXT lookup failed:", err)
|
c.log.Debugln("TXT lookup failed:", err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue