mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-09 11:46:42 -05:00
remove unused code
This commit is contained in:
parent
14483df744
commit
3a6f66d177
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user