mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
Dedup protocol registration
This commit is contained in:
parent
8c499d8fd2
commit
794dfd5bf3
@ -10,7 +10,9 @@ var (
|
||||
)
|
||||
|
||||
func RegisterProtocolConfigCreator(protocol TransportProtocol, creator ConfigCreator) error {
|
||||
// TODO: check duplicate
|
||||
if _, found := globalTransportConfigCreatorCache[protocol]; found {
|
||||
return newError("protocol: " + TransportProtocol_name[int32(protocol)]+ " is already registered").AtError()
|
||||
}
|
||||
globalTransportConfigCreatorCache[protocol] = creator
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user