add route for recorder

This commit is contained in:
ginuerzh
2024-09-24 20:20:15 +08:00
parent dd179bc951
commit e22aa91571
26 changed files with 364 additions and 117 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
package dns
import (
"bytes"
"context"
"errors"
"fmt"
@@ -290,7 +291,10 @@ func (h *dnsHandler) request(ctx context.Context, msg []byte, ro *xrecorder.Hand
}
log.Debugf("exchange message %d: %s", mq.Id, mq.Question[0].String())
mr, err := h.exchange(ctx, ex, &mq)
var buf bytes.Buffer
mr, err := h.exchange(ctxvalue.ContextWithBuffer(ctx, &buf), ex, &mq)
ro.Route = buf.String()
if err != nil {
return nil, err
}