mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
apply coding style
This commit is contained in:
parent
d0d09dfa7f
commit
9a03b425c9
@ -200,9 +200,7 @@ func (s *DNS) lookupIPInternal(domain string, option dns.IPOption) ([]net.IP, er
|
||||
}
|
||||
|
||||
// Normalize the FQDN form query
|
||||
if strings.HasSuffix(domain, ".") {
|
||||
domain = domain[:len(domain)-1]
|
||||
}
|
||||
domain = strings.TrimSuffix(domain, ".")
|
||||
|
||||
// Static host lookup
|
||||
switch addrs := s.hosts.Lookup(domain, option); {
|
||||
|
@ -154,7 +154,7 @@ func (p *StaticMuxPicker) PickAvailable() (*mux.ClientWorker, error) {
|
||||
return nil, newError("empty worker list")
|
||||
}
|
||||
|
||||
var minIdx int = -1
|
||||
var minIdx = -1
|
||||
var minConn uint32 = 9999
|
||||
for i, w := range p.workers {
|
||||
if w.draining {
|
||||
|
@ -26,7 +26,7 @@ func (ctx *ResolvableContext) GetTargetIPs() []net.IP {
|
||||
}
|
||||
|
||||
if domain := ctx.GetTargetDomain(); len(domain) != 0 {
|
||||
var lookupFunc func(string) ([]net.IP, error) = ctx.dnsClient.LookupIP
|
||||
var lookupFunc = ctx.dnsClient.LookupIP
|
||||
ipOption := &dns.IPOption{
|
||||
IPv4Enable: true,
|
||||
IPv6Enable: true,
|
||||
|
@ -66,7 +66,7 @@ func (h *Handler) resolveIP(ctx context.Context, domain string, localAddr net.Ad
|
||||
newError("DNS client doesn't implement ClientWithIPOption")
|
||||
}
|
||||
|
||||
var lookupFunc func(string) ([]net.IP, error) = h.dns.LookupIP
|
||||
var lookupFunc = h.dns.LookupIP
|
||||
if h.config.DomainStrategy == Config_USE_IP4 || (localAddr != nil && localAddr.Family().IsIPv4()) {
|
||||
if lookupIPv4, ok := h.dns.(dns.IPv4Lookup); ok {
|
||||
lookupFunc = lookupIPv4.LookupIPv4
|
||||
|
Loading…
Reference in New Issue
Block a user