Procházet zdrojové kódy

remove unused code

Darien Raymond před 8 roky
rodič
revize
3a6f66d177
2 změnil soubory, kde provedl 0 přidání a 21 odebrání
  1. 0 14
      proxy/blackhole/config.go
  2. 0 7
      proxy/socks/config.go

+ 0 - 14
proxy/blackhole/config.go

@@ -1,9 +1,6 @@
 package blackhole
 
 import (
-	"github.com/golang/protobuf/ptypes"
-	"github.com/golang/protobuf/ptypes/any"
-
 	"v2ray.com/core/common/buf"
 	"v2ray.com/core/common/serial"
 )
@@ -19,28 +16,17 @@ Content-Length: 0
 )
 
 type ResponseConfig interface {
-	AsAny() *any.Any
 	WriteTo(buf.Writer)
 }
 
 func (v *NoneResponse) WriteTo(buf.Writer) {}
 
-func (v *NoneResponse) AsAny() *any.Any {
-	r, _ := ptypes.MarshalAny(v)
-	return r
-}
-
 func (v *HTTPResponse) WriteTo(writer buf.Writer) {
 	b := buf.NewLocal(512)
 	b.AppendSupplier(serial.WriteString(http403response))
 	writer.Write(b)
 }
 
-func (v *HTTPResponse) AsAny() *any.Any {
-	r, _ := ptypes.MarshalAny(v)
-	return r
-}
-
 func (v *Config) GetInternalResponse() (ResponseConfig, error) {
 	if v.GetResponse() == nil {
 		return new(NoneResponse), nil

+ 0 - 7
proxy/socks/config.go

@@ -3,9 +3,6 @@ package socks
 import (
 	v2net "v2ray.com/core/common/net"
 	"v2ray.com/core/common/protocol"
-
-	"github.com/golang/protobuf/ptypes"
-	google_protobuf "github.com/golang/protobuf/ptypes/any"
 )
 
 func (v *Account) Equals(another protocol.Account) bool {
@@ -23,10 +20,6 @@ func NewAccount() protocol.AsAccount {
 	return &Account{}
 }
 
-func (v *Account) AsAny() (*google_protobuf.Any, error) {
-	return ptypes.MarshalAny(v)
-}
-
 func (v *ServerConfig) HasAccount(username, password string) bool {
 	if v.Accounts == nil {
 		return false