Property identifer is a varint.

pull/1022/head
Roger A. Light 7 years ago
parent 572be268e5
commit 75b6851c76

@ -29,6 +29,7 @@ Contributors:
int property__read(struct mosquitto__packet *packet, int32_t *len) int property__read(struct mosquitto__packet *packet, int32_t *len)
{ {
int rc; int rc;
int32_t property_identifier;
uint8_t byte; uint8_t byte;
int8_t byte_count; int8_t byte_count;
uint16_t uint16; uint16_t uint16;
@ -38,11 +39,11 @@ int property__read(struct mosquitto__packet *packet, int32_t *len)
int slen; int slen;
*len -= 14; *len -= 14;
rc = packet__read_byte(packet, &byte); rc = packet__read_varint(packet, &property_identifier, NULL);
if(rc) return rc; if(rc) return rc;
*len -= 1; *len -= 1;
switch(byte){ switch(property_identifier){
case PROP_PAYLOAD_FORMAT_INDICATOR: case PROP_PAYLOAD_FORMAT_INDICATOR:
rc = packet__read_byte(packet, &byte); rc = packet__read_byte(packet, &byte);
if(rc) return rc; if(rc) return rc;

Loading…
Cancel
Save