mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-26 11:44:22 -04:00
Merge pull request #924 from yujinqiu/dedup-protocol-register
Dedup protocol registration
This commit is contained in:
commit
4b5a5810a3
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user