1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 18:00:43 +00:00

remove unused functions

This commit is contained in:
Darien Raymond 2019-01-06 20:33:58 +01:00
parent a1b552f948
commit a1b33c3bd6
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
8 changed files with 10 additions and 26 deletions

View File

@ -30,15 +30,7 @@ func transportProtocolToString(protocol TransportProtocol) string {
}
}
func RegisterProtocolConfigCreator(protocol TransportProtocol, creator ConfigCreator) error {
name := transportProtocolToString(protocol)
if name == unknownProtocol {
return newError("protocol ", TransportProtocol_name[int32(protocol)], " is not supported").AtError()
}
return RegisterProtocolConfigCreatorByName(name, creator)
}
func RegisterProtocolConfigCreatorByName(name string, creator ConfigCreator) error {
func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error {
if _, found := globalTransportConfigCreatorCache[name]; found {
return newError("protocol ", name, " is already registered").AtError()
}
@ -46,15 +38,7 @@ func RegisterProtocolConfigCreatorByName(name string, creator ConfigCreator) err
return nil
}
func CreateTransportConfig(protocol TransportProtocol) (interface{}, error) {
name := transportProtocolToString(protocol)
if name == unknownProtocol {
return nil, newError("protocol ", TransportProtocol_name[int32(protocol)], " is not supported").AtError()
}
return CreateTransportConfigByName(name)
}
func CreateTransportConfigByName(name string) (interface{}, error) {
func CreateTransportConfig(name string) (interface{}, error) {
creator, ok := globalTransportConfigCreatorCache[name]
if !ok {
return nil, newError("unknown transport protocol: ", name)
@ -106,7 +90,7 @@ func (c *StreamConfig) GetTransportSettingsFor(protocol string) (interface{}, er
}
}
return CreateTransportConfigByName(protocol)
return CreateTransportConfig(protocol)
}
func (c *StreamConfig) GetEffectiveSecuritySettings() (interface{}, error) {

View File

@ -23,7 +23,7 @@ func (c *Config) GetUnixAddr() (*net.UnixAddr, error) {
}
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -41,7 +41,7 @@ func (c *Config) getNormalizedPath() string {
}
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -99,7 +99,7 @@ func (c *Config) GetReceivingBufferSize() uint32 {
}
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -17,7 +17,7 @@ const protocolName = "quic"
const internalDomain = "quic.internal.v2ray.com"
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -8,7 +8,7 @@ import (
const protocolName = "tcp"
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -6,7 +6,7 @@ import (
)
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}

View File

@ -29,7 +29,7 @@ func (c *Config) GetRequestHeader() http.Header {
}
func init() {
common.Must(internet.RegisterProtocolConfigCreatorByName(protocolName, func() interface{} {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}