Skip to content

paho mqtt port does not send PUBLISH_COMPLETE message for QoS 2 #771

@YehonatanLiron

Description

@YehonatanLiron

The "cycle" function does not handle PUBLISH_RELEASE messages by sending PUBLISH_COMPLETE, so QoS 2 exchanges are not completed.

case MQTTPACKET_PUBREL:

        {
            unsigned short mypacketid;
            unsigned char dup, type;
            if (mqtt_deserialize_ack(&type, &dup, &mypacketid, c->readbuf, c->readbuf_size) != 1)
            {
                rc = MQTT_FAILURE;
            }
            else if ((len = mqtt_serialize_ack(c->buf, c->buf_size, MQTTPACKET_PUBCOMP, 0, mypacketid)) <= 0)
            {
                rc = MQTT_FAILURE;
            }
            else if ((rc = send_packet(c, len, timer)) != MQTT_SUCCESS) // send the MQTTPACKET_PUBCOMP packet
            {
                rc = MQTT_FAILURE; // there was a problem
            }
            if (rc == MQTT_FAILURE)
                goto exit; // there was a problem
            break;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions