[agent/codex:gpt-5.4-mini] Read docs/RFC.md fully. Find ONE feature described in the sp... #55

Merged
Virgil merged 1 commit from main into dev 2026-04-03 21:58:31 +00:00
2 changed files with 13 additions and 9 deletions

View file

@ -112,14 +112,14 @@ func (service *Service) Serve(bind string, port int) (*DNSServer, error) {
return nil, err
}
handler := &dnsRequestHandler{service: service}
mux := dnsprotocol.NewServeMux()
mux.HandleFunc(".", handler.ServeDNS)
requestHandler := &dnsRequestHandler{service: service}
serveMux := dnsprotocol.NewServeMux()
serveMux.HandleFunc(".", requestHandler.ServeDNS)
udpServer := &dnsprotocol.Server{Net: "udp", PacketConn: udpListener, Handler: mux}
tcpServer := &dnsprotocol.Server{Net: "tcp", Listener: tcpListener, Handler: mux}
udpServer := &dnsprotocol.Server{Net: "udp", PacketConn: udpListener, Handler: serveMux}
tcpServer := &dnsprotocol.Server{Net: "tcp", Listener: tcpListener, Handler: serveMux}
run := &DNSServer{
dnsServer := &DNSServer{
udpListener: udpListener,
tcpListener: tcpListener,
udpServer: udpServer,
@ -133,7 +133,7 @@ func (service *Service) Serve(bind string, port int) (*DNSServer, error) {
_ = tcpServer.ActivateAndServe()
}()
return run, nil
return dnsServer, nil
}
// ServeAll starts DNS and health together.

View file

@ -672,9 +672,12 @@ func (service *Service) ResolveReverse(ip string) ([]string, bool) {
}
// ResolveAll returns the full record set for a name, including synthesized apex NS data.
// Missing names still return empty arrays so the action payload stays stable.
//
// result, ok := service.ResolveAll("charon.lthn")
// // result = dns.ResolveAllResult{A: nil, AAAA: nil, TXT: nil, NS: []string{"ns.charon.lthn"}}
// // ok = true
//
// Missing names still return empty arrays so the action payload stays stable.
func (service *Service) ResolveAll(name string) (ResolveAllResult, bool) {
record, ok := service.findRecord(name)
if !ok {
@ -703,7 +706,7 @@ func (service *Service) ResolveAll(name string) (ResolveAllResult, bool) {
// Health reports the live cache size and tree root.
//
// health := service.Health()
// fmt.Println(health.TreeRoot)
// fmt.Println(health.Status, health.NamesCached, health.TreeRoot)
func (service *Service) Health() HealthResult {
service.mu.RLock()
defer service.mu.RUnlock()
@ -723,6 +726,7 @@ func (service *Service) Health() HealthResult {
// ZoneApex returns the computed apex for the current record set.
//
// apex := service.ZoneApex()
// // "charon.lthn"
func (service *Service) ZoneApex() string {
service.mu.RLock()
defer service.mu.RUnlock()