remove unused functions

pull/1535/head
Darien Raymond 6 years ago
parent a1b552f948
commit a1b33c3bd6
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -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) {

@ -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)
}))
}

@ -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)
}))
}

@ -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)
}))
}

@ -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)
}))
}

@ -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)
}))
}

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

@ -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)
}))
}

Loading…
Cancel
Save