From 3a6f66d17739672765d90fff698caee55e120407 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 21 Dec 2016 16:00:16 +0100 Subject: [PATCH] remove unused code --- proxy/blackhole/config.go | 14 -------------- proxy/socks/config.go | 7 ------- 2 files changed, 21 deletions(-) diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index 78d669e4..147a3fc3 100644 --- a/proxy/blackhole/config.go +++ b/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 diff --git a/proxy/socks/config.go b/proxy/socks/config.go index cd013220..caaddad0 100644 --- a/proxy/socks/config.go +++ b/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