Remove legacy code (#3838)

* Add feature migration notice

* Remove legacy code of transport processing

* Clear legacy proto field

* Fix missing

* Unify protocolname

* Test remove

* Supressor

* Weird code

* Remove errorgen related comments
This commit is contained in:
Kobe Arthur Scofield 2024-09-23 23:28:19 +08:00 committed by GitHub
parent d497de916f
commit 7086d286be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 206 additions and 512 deletions

View file

@ -28,25 +28,6 @@ var strategy = [][]byte{
const unknownProtocol = "unknown"
func transportProtocolToString(protocol TransportProtocol) string {
switch protocol {
case TransportProtocol_TCP:
return "tcp"
case TransportProtocol_UDP:
return "udp"
case TransportProtocol_HTTP:
return "http"
case TransportProtocol_MKCP:
return "mkcp"
case TransportProtocol_WebSocket:
return "websocket"
case TransportProtocol_HTTPUpgrade:
return "httpupgrade"
default:
return unknownProtocol
}
}
func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error {
if _, found := globalTransportConfigCreatorCache[name]; found {
return errors.New("protocol ", name, " is already registered").AtError()
@ -70,23 +51,15 @@ func (c *TransportConfig) GetTypedSettings() (interface{}, error) {
}
func (c *TransportConfig) GetUnifiedProtocolName() string {
if len(c.ProtocolName) > 0 {
return c.ProtocolName
}
return transportProtocolToString(c.Protocol)
return c.ProtocolName
}
func (c *StreamConfig) GetEffectiveProtocol() string {
if c == nil {
if c == nil || len(c.ProtocolName) == 0 {
return "tcp"
}
if len(c.ProtocolName) > 0 {
return c.ProtocolName
}
return transportProtocolToString(c.Protocol)
return c.ProtocolName
}
func (c *StreamConfig) GetEffectiveTransportSettings() (interface{}, error) {