New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bridge connection to public broker fails because of invalid UTF-8 topic names #1144
Comments
The MQTT spec is pretty clear on the required behaviour here.
The issue at hand is that iot.eclipse.org isn't kept up to date, and so isn't validating UTF-8 strings. It is worth noting that the test server at iot.eclipse.org is going to disappear soon: https://bugs.eclipse.org/bugs/show_bug.cgi?id=541419 |
OK. I understand. |
@krismattheus Agreed, I've just added in a new log message to cover this case. |
Closes #1144. Thanks to Kris Mattheus.
Closes #1144. Thanks to Kris Mattheus.
When testing our mosquitto broker to make a bridge connection to the iot.eclipse.org mosquitto broker, the bridge connection is established but within the same second it's disconnected again.
This only happens when the configuration of our bridge contains:
topic # both 0
When a specific topic is used, the bridge connection remains established.
After some debugging I found that the iot.eclipse.org mosquitto broker contains topics with invalid UTF-8 names (for example 'ÿ' with only one byte = 0xFF). Apparently, a disconnect is forced in handle_publish.c when a PUBLISH message contains an invalid UTF-8 topic.
mosquitto/src/handle_publish.c
Lines 72 to 75 in 19fbbd8
I think it would be better to just ignore such a topic and continue with the next PUBLISH messages.
Maybe the code in handle_publish.c should be changed to:
We use mosquitto version 1.5.5.
The test was done on Windows 10.
The text was updated successfully, but these errors were encountered: