Update emqtt_frame.erl
fix the packet parser to retrive the topic name
hello @zmstone, sorry about the lac of the context,
i have try to create an tcp elixir "mqtt proxy" to a broker, and i have using this lib to parse mqtt packets, and i have tested using the MQTTX, and i really dont know why this is happend, i just find this aditional byte in topics, and when i ignore, my code works.
Hi @gabrielmancini
SUBSCRIBE packet is for server to parse, I have to admit that it's possible that there is a lack of test coverage here in emqtt since it's a client library.
Had a quick look into the server side code (which is extensively tested) here: https://github.com/emqx/emqx/blob/bc7668078c80bf51ad996342e8ee6681adce41a4/apps/emqx/src/emqx_frame.erl#L659-L665
They seem to be the same, and I cannot seem to spot where the leading byte might have leaked from. It would be great if you can:
- Find the root cause (the byte must belong to the leading part of the SUBSCRIBE packet, before topics list)
- Add a test case