Dedup protocol registration

pull/924/head
Jinqiu Yu 7 years ago
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…
Cancel
Save