1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

cleanup unused scenarios

This commit is contained in:
Darien Raymond
2018-10-22 22:40:53 +02:00
parent 17e51b277b
commit c2566e1331
4 changed files with 23 additions and 41 deletions

View File

@@ -8,7 +8,6 @@ import (
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/proxy"
)
type Condition interface {
@@ -155,7 +154,7 @@ func targetFromContent(ctx context.Context) net.Destination {
func (v *CIDRMatcher) Apply(ctx context.Context) bool {
ips := make([]net.IP, 0, 4)
if resolver, ok := proxy.ResolvedIPsFromContext(ctx); ok {
if resolver, ok := ResolvedIPsFromContext(ctx); ok {
resolvedIPs := resolver.Resolve()
for _, rip := range resolvedIPs {
if !rip.Family().IsIPv6() {
@@ -198,7 +197,7 @@ func NewIPv4Matcher(ipnet *net.IPNetTable, onSource bool) *IPv4Matcher {
func (v *IPv4Matcher) Apply(ctx context.Context) bool {
ips := make([]net.IP, 0, 4)
if resolver, ok := proxy.ResolvedIPsFromContext(ctx); ok {
if resolver, ok := ResolvedIPsFromContext(ctx); ok {
resolvedIPs := resolver.Resolve()
for _, rip := range resolvedIPs {
if !rip.Family().IsIPv4() {