1
0
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:
Jinqiu Yu 2018-03-06 15:24:52 +08:00
parent 8c499d8fd2
commit 794dfd5bf3

View File

@ -10,7 +10,9 @@ var (
) )
func RegisterProtocolConfigCreator(protocol TransportProtocol, creator ConfigCreator) error { 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 globalTransportConfigCreatorCache[protocol] = creator
return nil return nil
} }