samples: net: google_iot_mqtt: Change read publish to blocking
Avoid endless loop in `case MQTT_EVT_PUBLISH` Fail on any error for mqtt_read_publish_payload_blocking, inc. -EAGAIN. Fixes zephyrproject-rtos#40965 Signed-off-by: Jeffrey Urban <jeffrey@jeffreyurban.com>
This commit is contained in:
parent
4c8bdd8992
commit
34a958f545
1 changed files with 2 additions and 2 deletions
|
@ -165,10 +165,10 @@ void mqtt_evt_handler(struct mqtt_client *const client,
|
|||
|
||||
/* assuming the config message is textual */
|
||||
while (len) {
|
||||
bytes_read = mqtt_read_publish_payload(
|
||||
bytes_read = mqtt_read_publish_payload_blocking(
|
||||
client, d,
|
||||
len >= 32 ? 32 : len);
|
||||
if (bytes_read < 0 && bytes_read != -EAGAIN) {
|
||||
if (bytes_read < 0) {
|
||||
LOG_ERR("failure to read payload");
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue