From e722a97987031fc0affd715b55957b6f62b787f7 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Mon, 24 Mar 2025 22:26:59 +0000 Subject: [PATCH] Don't use assert() in MeshService to guard queueing packets (#6388) --- src/mesh/MeshService.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index f293559ad..297c7b2ed 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -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++; }