mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
mqtt: check data_cb != NULL
This commit is contained in:
parent
d7a0757764
commit
1f4a029d10
@ -770,7 +770,9 @@ mqtt_message_received(mqtt_client_t *client, u8_t fixed_hdr_len, u16_t length, u
|
|||||||
LWIP_DEBUGF(MQTT_DEBUG_WARN,( "mqtt_message_received: Received short packet (payload)\n"));
|
LWIP_DEBUGF(MQTT_DEBUG_WARN,( "mqtt_message_received: Received short packet (payload)\n"));
|
||||||
goto out_disconnect;
|
goto out_disconnect;
|
||||||
}
|
}
|
||||||
|
if (client->data_cb != NULL) {
|
||||||
client->data_cb(client->inpub_arg, var_hdr_payload + payload_offset, payload_length, remaining_length == 0 ? MQTT_DATA_FLAG_LAST : 0);
|
client->data_cb(client->inpub_arg, var_hdr_payload + payload_offset, payload_length, remaining_length == 0 ? MQTT_DATA_FLAG_LAST : 0);
|
||||||
|
}
|
||||||
/* Reply if QoS > 0 */
|
/* Reply if QoS > 0 */
|
||||||
if (remaining_length == 0 && qos > 0) {
|
if (remaining_length == 0 && qos > 0) {
|
||||||
/* Send PUBACK for QoS 1 or PUBREC for QoS 2 */
|
/* Send PUBACK for QoS 1 or PUBREC for QoS 2 */
|
||||||
|
Loading…
Reference in New Issue
Block a user