eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 883 forks source link

MQTTv5 the available properties are not handled correctly #539

Closed borgendale closed 6 years ago

borgendale commented 6 years ago

The properties Wildcard Subscription Available, Subscription Identifiers Available, and Shared Subscription Available are defined by the spec to have a value of 1 (true) if not specified. The current paho code defaults them to 0 (false) and sets them to 1 if they are specified in the CONNACK regardless of the value specified. Thus in almost all cases the value is wrong.

On the other hand, the value is very well hidden. These values are set into the MqttSession object from which they are are visible to the client application. With some effort the client application can find them. However, the paho client should be enforcing these properties as ignoring them means that the client will send invalid MQTT packets to the server (in violation of MUST clauses).

If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new

jpwsutton commented 6 years ago

Thanks @borgendale, the Retain Available property was also similarly affected, so I've fixed that as well.