v2ray před 9 roky
rodič
revize
1e79a3b75a

+ 4 - 4
app/router/rules/router.go

@@ -10,8 +10,8 @@ import (
 )
 
 var (
-	InvalidRule      = errors.New("Invalid Rule")
-	NoRuleApplicable = errors.New("No rule applicable")
+	ErrorInvalidRule      = errors.New("Invalid Rule")
+	ErrorNoRuleApplicable = errors.New("No rule applicable")
 )
 
 type cacheEntry struct {
@@ -60,7 +60,7 @@ func (this *Router) takeDetourWithoutCache(dest v2net.Destination) (string, erro
 			return rule.Tag, nil
 		}
 	}
-	return "", NoRuleApplicable
+	return "", ErrorNoRuleApplicable
 }
 
 func (this *Router) TakeDetour(dest v2net.Destination) (string, error) {
@@ -83,7 +83,7 @@ func (this *RouterFactory) Create(rawConfig interface{}) (router.Router, error)
 	router := NewRouter()
 	for _, rule := range rules {
 		if rule == nil {
-			return nil, InvalidRule
+			return nil, ErrorInvalidRule
 		}
 		router.AddRule(rule)
 	}

+ 2 - 2
proxy/socks/socks.go

@@ -19,7 +19,7 @@ import (
 
 var (
 	ErrorUnsupportedSocksCommand = errors.New("Unsupported socks command.")
-	UnsupportedAuthMethod        = errors.New("Unsupported auth method.")
+	ErrorUnsupportedAuthMethod   = errors.New("Unsupported auth method.")
 )
 
 // SocksServer is a SOCKS 5 proxy server
@@ -119,7 +119,7 @@ func (this *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.Wri
 			return err
 		}
 		log.Warning("Socks: client doesn't support allowed any auth methods.")
-		return UnsupportedAuthMethod
+		return ErrorUnsupportedAuthMethod
 	}
 
 	authResponse := protocol.NewAuthenticationResponse(expectedAuthMethod)

+ 2 - 2
transport/dialer/dialer.go

@@ -9,7 +9,7 @@ import (
 )
 
 var (
-	ErrInvalidHost = errors.New("Invalid Host.")
+	ErrorInvalidHost = errors.New("Invalid Host.")
 )
 
 func Dial(dest v2net.Destination) (net.Conn, error) {
@@ -22,7 +22,7 @@ func Dial(dest v2net.Destination) (net.Conn, error) {
 			return nil, err
 		}
 		if len(ips) == 0 {
-			return nil, ErrInvalidHost
+			return nil, ErrorInvalidHost
 		}
 		ip = ips[dice.Roll(len(ips))]
 	}