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
message_size_limit ignores the size of Will message and MQTT5 properties #2022
Comments
I would definitely recommend the use of Either way, the WIll payload should not be exempt from the |
Hello,
while performing some tests I noticed that, if setting the
message_size_limit
in the Mosquitto configuration, clients can bypass it via connect Will messages (with a payload up to 65'535 characters) or, with MQTT5 packets, by specifying large/many user properties (with a limit of 65'535 characters for each property name/value). Is it a bug or the intended behaviour?- I'm asking because I could not find any reference for Will/Properties limitations in the OASIS MQTT 3/5 specifications and, in any case, Mosquitto supports limiting any MQTT packet (as a whole) via
max_packet_size
.To replicate, here is a Paho Python script that sets a 65'535 characters Will message, publish a 1 character payload message (with two user properties of 65'535 x 2 chars) and disconnect with Reason Code
4 (hence publishing the Will message). A subscriber connected with
mosquitto_sub -t topic -t will/topic -V 5 -F %%Payload:%p\\n%%Properties:%P\\n
will receive both messages and the user properties of the PUBLISH.Mosquitto is configure to restrict payload size to 1 byte with the following:
The text was updated successfully, but these errors were encountered: