1
0
mirror of https://github.com/eclipse/mosquitto.git synced 2025-05-08 16:52:13 +08:00

Fix "payload format invalid" not being allowed as a PUBREC reason code.

Thanks to mdrssv
This commit is contained in:
Roger A. Light 2024-09-07 00:17:37 +01:00
parent f6d0ddcae0
commit 57b5549b3d
3 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Broker:
Library:
- Fix some error codes being converted to string as "unknown". Closes #2579.
- Clear SSL error state to avoid spurious error reporting. Closes #3054.
- Fix "payload format invalid" not being allowed as a PUBREC reason code.
Build:
- Thread support is re-enabled on Windows.

View File

@ -161,7 +161,7 @@ enum mqtt5_return_codes {
MQTT_RC_MESSAGE_RATE_TOO_HIGH = 150, /* DISCONNECT */
MQTT_RC_QUOTA_EXCEEDED = 151, /* PUBACK, PUBREC, SUBACK, DISCONNECT */
MQTT_RC_ADMINISTRATIVE_ACTION = 152, /* DISCONNECT */
MQTT_RC_PAYLOAD_FORMAT_INVALID = 153, /* CONNACK, DISCONNECT */
MQTT_RC_PAYLOAD_FORMAT_INVALID = 153, /* CONNACK, PUBACK, PUBREC, DISCONNECT */
MQTT_RC_RETAIN_NOT_SUPPORTED = 154, /* CONNACK, DISCONNECT */
MQTT_RC_QOS_NOT_SUPPORTED = 155, /* CONNACK, DISCONNECT */
MQTT_RC_USE_ANOTHER_SERVER = 156, /* CONNACK, DISCONNECT */

View File

@ -68,7 +68,8 @@ int handle__pubrec(struct mosquitto *mosq)
&& reason_code != MQTT_RC_NOT_AUTHORIZED
&& reason_code != MQTT_RC_TOPIC_NAME_INVALID
&& reason_code != MQTT_RC_PACKET_ID_IN_USE
&& reason_code != MQTT_RC_QUOTA_EXCEEDED){
&& reason_code != MQTT_RC_QUOTA_EXCEEDED
&& reason_code != MQTT_RC_PAYLOAD_FORMAT_INVALID){
return MOSQ_ERR_PROTOCOL;
}