Don't use assert() in MeshService to guard queueing packets (#6388)

This commit is contained in:
Chloe Bethel 2025-03-24 22:26:59 +00:00 committed by GitHub
parent daa4186d65
commit e722a97987
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -309,7 +309,10 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p)
}
}
assert(toPhoneQueue.enqueue(p, 0));
if (toPhoneQueue.enqueue(p, 0) == false) {
LOG_CRIT("Failed to queue a packet into toPhoneQueue!");
abort();
}
fromNum++;
}
@ -323,7 +326,10 @@ void MeshService::sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage
releaseMqttClientProxyMessageToPool(d);
}
assert(toPhoneMqttProxyQueue.enqueue(m, 0));
if (toPhoneMqttProxyQueue.enqueue(m, 0) == false) {
LOG_CRIT("Failed to queue a packet into toPhoneMqttProxyQueue!");
abort();
}
fromNum++;
}
@ -337,7 +343,10 @@ void MeshService::sendClientNotification(meshtastic_ClientNotification *n)
releaseClientNotificationToPool(d);
}
assert(toPhoneClientNotificationQueue.enqueue(n, 0));
if (toPhoneClientNotificationQueue.enqueue(n, 0) == false) {
LOG_CRIT("Failed to queue a notification into toPhoneClientNotificationQueue!");
abort();
}
fromNum++;
}