| 548 | } |
| 549 | |
| 550 | func (s *DNSManager) getDNSPresentMemory(dnsName, recType, value string) (dnsPresentMemory, error) { |
| 551 | s.recordsMu.Lock() |
| 552 | defer s.recordsMu.Unlock() |
| 553 | |
| 554 | var memory dnsPresentMemory |
| 555 | var found bool |
| 556 | for _, mem := range s.records[dnsName] { |
| 557 | rr := mem.zoneRec.record.RR() |
| 558 | if rr.Type == recType && rr.Data == value { |
| 559 | memory = mem |
| 560 | found = true |
| 561 | break |
| 562 | } |
| 563 | } |
| 564 | if !found { |
| 565 | return dnsPresentMemory{}, fmt.Errorf("no memory of presenting a DNS record for %q (usually OK if presenting also failed)", dnsName) |
| 566 | } |
| 567 | |
| 568 | return memory, nil |
| 569 | } |
| 570 | |
| 571 | func (s *DNSManager) deleteDNSPresentMemory(dnsName, keyAuth string) { |
| 572 | s.recordsMu.Lock() |