diff --git a/src/emqttd_parser.erl b/src/emqttd_parser.erl index 5788499b4..bca942130 100644 --- a/src/emqttd_parser.erl +++ b/src/emqttd_parser.erl @@ -74,7 +74,8 @@ parse_frame(Bin, #mqtt_packet_header{type = Type, qos = Qos} = Header, Length) case {Type, Bin} of {?CONNECT, <>} -> {ProtoName, Rest1} = parse_utf(FrameBin), - <> = Rest1, + %% Fix mosquitto bridge: 0x83, 0x84 + <<_Bridge:4, ProtoVersion:4, Rest2/binary>> = Rest1, <>, _) -> bool(0) -> false; bool(1) -> true. -%% Fix mosquitto bridge: 0x83, 0x84 protocol_name_approved(Ver, Name) -> - lists:member({Ver band 16#0F, Name}, ?PROTOCOL_NAMES). + lists:member({Ver, Name}, ?PROTOCOL_NAMES).