remove unused code

pull/467/head
Darien Raymond 2016-12-21 16:00:16 +01:00
parent 14483df744
commit 3a6f66d177
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 0 additions and 21 deletions

View File

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

View File

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