Fix the issue that protocol is undefined
This commit is contained in:
parent
1e4c51f080
commit
de44a89c21
|
@ -525,7 +525,10 @@ handle_out({connack, ReasonCode}, Channel = #channel{client = Client,
|
||||||
protocol = Protocol
|
protocol = Protocol
|
||||||
}) ->
|
}) ->
|
||||||
ok = emqx_hooks:run('client.connected', [Client, ReasonCode, attrs(Channel)]),
|
ok = emqx_hooks:run('client.connected', [Client, ReasonCode, attrs(Channel)]),
|
||||||
ProtoVer = emqx_protocol:info(proto_ver, Protocol),
|
ProtoVer = case Protocol of
|
||||||
|
undefined -> undefined;
|
||||||
|
_ -> emqx_protocol:info(proto_ver, Protocol)
|
||||||
|
end,
|
||||||
ReasonCode1 = if
|
ReasonCode1 = if
|
||||||
ProtoVer == ?MQTT_PROTO_V5 -> ReasonCode;
|
ProtoVer == ?MQTT_PROTO_V5 -> ReasonCode;
|
||||||
true -> emqx_reason_codes:compat(connack, ReasonCode)
|
true -> emqx_reason_codes:compat(connack, ReasonCode)
|
||||||
|
|
Loading…
Reference in New Issue