Read reason code for PUBREC/PUBREL.

pull/1203/head
Roger A. Light 7 years ago
parent c1baf21185
commit 659cd2a3b1

@ -42,6 +42,7 @@ int handle__pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const ch
int handle__pubackcomp(struct mosquitto *mosq, const char *type)
#endif
{
uint8_t reason_code;
uint16_t mid;
int rc;
mosquitto_property *properties = NULL;
@ -52,6 +53,9 @@ int handle__pubackcomp(struct mosquitto *mosq, const char *type)
if(mid == 0) return MOSQ_ERR_PROTOCOL;
if(mosq->protocol == mosq_p_mqtt5){
rc = packet__read_byte(&mosq->in_packet, &reason_code);
if(rc) return rc;
rc = property__read_all(CMD_PUBACK, &mosq->in_packet, &properties);
if(rc) return rc;
}

@ -37,6 +37,7 @@ Contributors:
int handle__pubrec(struct mosquitto *mosq)
{
uint8_t reason_code;
uint16_t mid;
int rc;
mosquitto_property *properties = NULL;
@ -47,6 +48,9 @@ int handle__pubrec(struct mosquitto *mosq)
if(mid == 0) return MOSQ_ERR_PROTOCOL;
if(mosq->protocol == mosq_p_mqtt5){
rc = packet__read_byte(&mosq->in_packet, &reason_code);
if(rc) return rc;
rc = property__read_all(CMD_PUBREC, &mosq->in_packet, &properties);
if(rc) return rc;
/* Immediately free, we don't do anything with Reason String or User Property at the moment */

@ -38,6 +38,7 @@ Contributors:
int handle__pubrel(struct mosquitto_db *db, struct mosquitto *mosq)
{
uint8_t reason_code;
uint16_t mid;
#ifndef WITH_BROKER
struct mosquitto_message_all *message = NULL;
@ -56,6 +57,9 @@ int handle__pubrel(struct mosquitto_db *db, struct mosquitto *mosq)
if(mid == 0) return MOSQ_ERR_PROTOCOL;
if(mosq->protocol == mosq_p_mqtt5){
rc = packet__read_byte(&mosq->in_packet, &reason_code);
if(rc) return rc;
rc = property__read_all(CMD_PUBREL, &mosq->in_packet, &properties);
if(rc) return rc;
}

Loading…
Cancel
Save