mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
general: bump version
This commit is contained in:
1 parent
d6d706b5ee
commit
2c4aa26055
4 files changed
+8
-6
No files matched your search
+4
-2
@@ -123,13 +123,15 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([
|
||||
}
|
||||
|
||||
// exchange choose a upstream dns server based on qname, communicate with it on the network.
|
||||
func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (server, network, dialerAddr string, respBytes []byte, err error) {
|
||||
func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (
|
||||
server, network, dialerAddr string, respBytes []byte, err error) {
|
||||
|
||||
// use tcp to connect upstream server default
|
||||
network = "tcp"
|
||||
dialer := c.proxy.NextDialer(qname + ":53")
|
||||
|
||||
// if we are resolving the dialer's domain, then use Direct to avoid denpency loop
|
||||
// TODO: dialer.Addr() == "reject", tricky
|
||||
// TODO: dialer.Addr() == "REJECT", tricky
|
||||
if strings.Contains(dialer.Addr(), qname) || dialer.Addr() == "REJECT" {
|
||||
dialer = proxy.Default
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user