mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 23:06:30 -05:00
apply coding style
This commit is contained in:
parent
2f35bbecbe
commit
1e282944a6
@ -60,9 +60,9 @@ func (f fakeDNSSniffResult) Domain() string {
|
||||
return f.domainName
|
||||
}
|
||||
|
||||
type fakeDnsExtraOpts int
|
||||
type fakeDNSExtraOpts int
|
||||
|
||||
const ipAddressInRange fakeDnsExtraOpts = 1
|
||||
const ipAddressInRange fakeDNSExtraOpts = 1
|
||||
|
||||
type ipAddressInRangeOpt struct {
|
||||
addressInRange *bool
|
||||
@ -107,10 +107,9 @@ func newFakeDNSThenOthers(ctx context.Context, fakeDNSSniffer protocolSnifferWit
|
||||
}
|
||||
}
|
||||
return nil, common.ErrNoClue
|
||||
} else {
|
||||
}
|
||||
newError("ip address not in fake dns range, return as is").AtDebug().WriteToLog()
|
||||
return nil, common.ErrNoClue
|
||||
}
|
||||
} else {
|
||||
newError("fake dns sniffer did not set address in range option, assume false.").AtWarning().WriteToLog()
|
||||
return nil, common.ErrNoClue
|
||||
|
@ -27,9 +27,9 @@ func (fkdns *Holder) IsIPInIPPool(ip net.Address) bool {
|
||||
return fkdns.ipRange.Contains(ip.IP())
|
||||
}
|
||||
|
||||
func (fkdns *Holder) GetFakeIPForDomain3(domain string, IPv4, IPv6 bool) []net.Address {
|
||||
func (fkdns *Holder) GetFakeIPForDomain3(domain string, ipv4, ipv6 bool) []net.Address {
|
||||
isIPv6 := fkdns.ipRange.IP.To4() == nil
|
||||
if (isIPv6 && IPv6) || (!isIPv6 && IPv4) {
|
||||
if (isIPv6 && ipv6) || (!isIPv6 && ipv4) {
|
||||
return fkdns.GetFakeIPForDomain(domain)
|
||||
}
|
||||
return []net.Address{}
|
||||
@ -147,10 +147,10 @@ func (h *HolderMulti) IsIPInIPPool(ip net.Address) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (h *HolderMulti) GetFakeIPForDomain3(domain string, IPv4, IPv6 bool) []net.Address {
|
||||
func (h *HolderMulti) GetFakeIPForDomain3(domain string, ipv4, ipv6 bool) []net.Address {
|
||||
var ret []net.Address
|
||||
for _, v := range h.holders {
|
||||
ret = append(ret, v.GetFakeIPForDomain3(domain, IPv4, IPv6)...)
|
||||
ret = append(ret, v.GetFakeIPForDomain3(domain, ipv4, ipv6)...)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
@ -118,10 +118,10 @@ func TestFakeDnsHolderCreateMappingAndRollOver(t *testing.T) {
|
||||
|
||||
func TestFakeDNSMulti(t *testing.T) {
|
||||
fakeMulti, err := NewFakeDNSHolderMulti(&FakeDnsPoolMulti{
|
||||
Pools: []*FakeDnsPool{&FakeDnsPool{
|
||||
Pools: []*FakeDnsPool{{
|
||||
IpPool: "240.0.0.0/12",
|
||||
LruSize: 256,
|
||||
}, &FakeDnsPool{
|
||||
}, {
|
||||
IpPool: "fddd:c5b4:ff5f:f4f0::/64",
|
||||
LruSize: 256,
|
||||
}},
|
||||
|
@ -589,6 +589,7 @@ func (c *Config) Build() (*core.Config, error) {
|
||||
sb := strings.Builder{}
|
||||
return nil, newError("Cannot load service").Base(developererr).Base(err).Base(newError(sb.String()))
|
||||
} else {
|
||||
// Using a else here is required to keep msg in scope
|
||||
config.App = append(config.App, msg...)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user