Skip to content

Commit

Permalink
Add references
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Dec 15, 2023
1 parent c4e3db5 commit e530b86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/dns/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func readStreamMsg(reader io.Reader) ([]byte, error) {
}

func NewTCPRoundTripper(sd transport.StreamDialer, resolverAddr string) RoundTripper {
// See https://cs.opensource.google/go/go/+/master:src/net/dnsclient_unix.go;l=127;drc=6146a73d279d73b6138191929d2f1fad22188f51
// TODO: Consider handling Authenticated Data.
baseClient := dns.Client{Net: "tcp"}
return FuncRoundTripper(func(ctx context.Context, request []byte) ([]byte, error) {
Expand All @@ -99,6 +100,7 @@ func NewTCPRoundTripper(sd transport.StreamDialer, resolverAddr string) RoundTri
}

func NewUDPRoundTripper(pd transport.PacketDialer, resolverAddr string) RoundTripper {
// See https://cs.opensource.google/go/go/+/master:src/net/dnsclient_unix.go;l=100;drc=6146a73d279d73b6138191929d2f1fad22188f51
baseClient := dns.Client{Net: ""}
return FuncRoundTripper(func(ctx context.Context, request []byte) ([]byte, error) {
conn, err := pd.Dial(ctx, resolverAddr)
Expand Down

0 comments on commit e530b86

Please sign in to comment.