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 {
|
||||
for _, record := range records {
|
||||
c.log.Traceln("Found TXT record:", record)
|
||||
if !strings.HasPrefix(record, "txt://") {
|
||||
return peerEntry{
|
||||
uri: fmt.Sprintf("%s", record),
|
||||
sintf: sintf,
|
||||
}, nil
|
||||
if strings.HasPrefix(record, "txt://") {
|
||||
// Prevents an infinite loop
|
||||
continue
|
||||
}
|
||||
return peerEntry{
|
||||
uri: fmt.Sprintf("%s", record),
|
||||
sintf: sintf,
|
||||
}, nil
|
||||
}
|
||||
} else {
|
||||
c.log.Debugln("TXT lookup failed:", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue