From 9b16ffe5930be747a10faf57cd4f91526bf080b7 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Fri, 9 Jun 2023 15:57:57 +0300 Subject: [PATCH] upstream: imp code --- upstream/upstream_plain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upstream/upstream_plain.go b/upstream/upstream_plain.go index f8d3be237..c127d4dab 100644 --- a/upstream/upstream_plain.go +++ b/upstream/upstream_plain.go @@ -66,7 +66,7 @@ func newPlain(addr *url.URL, opts *Options) (u *plainDNS, err error) { return &plainDNS{ addr: addr, getDialer: getDialer, - net: network(addr.Scheme), + net: addr.Scheme, timeout: opts.Timeout, }, nil } @@ -102,7 +102,7 @@ func (p *plainDNS) dialExchange( defer func() { logFinish(addr, network, err) }() ctx := context.Background() - conn.Conn, err = dial(ctx, string(network), "") + conn.Conn, err = dial(ctx, network, "") if err != nil { return nil, fmt.Errorf("dialing %s over %s: %w", p.addr.Host, network, err) } @@ -110,7 +110,7 @@ func (p *plainDNS) dialExchange( resp, _, err = client.ExchangeWithConn(req, conn) if isExpectedConnErr(err) { - conn.Conn, err = dial(ctx, string(network), "") + conn.Conn, err = dial(ctx, network, "") if err != nil { return nil, fmt.Errorf("dialing %s over %s again: %w", p.addr.Host, network, err) }