Stabilize concurrent SSH and WebSocket transports

This commit is contained in:
2026-08-26 23:53:13 +02:00
parent a350ba2f5e
commit fa339a3dfa
7 changed files with 71 additions and 51 deletions
+15
View File
@@ -11,6 +11,7 @@
#include "serial_service.h"
#define SESSION_BROKER_RX_CHUNK_SIZE 256U
#define SESSION_BROKER_ACTIVE_BURST_BYTES (8U * SESSION_BROKER_RX_CHUNK_SIZE)
#define SESSION_BROKER_TASK_STACK_SIZE 4096U
#define SESSION_BROKER_TASK_PRIORITY 9U
#define SESSION_BROKER_IDLE_POLL_MS 5U
@@ -160,6 +161,7 @@ static void broker_task(void *context)
{
(void)context;
uint8_t data[SESSION_BROKER_RX_CHUNK_SIZE];
size_t active_burst_bytes = 0U;
for (;;) {
/*
@@ -175,7 +177,20 @@ static void broker_task(void *context)
xSemaphoreGive(s_mutex);
if (received == 0U) {
active_burst_bytes = 0U;
vTaskDelay(milliseconds_to_ticks(SESSION_BROKER_IDLE_POLL_MS));
} else {
active_burst_bytes += received;
if (active_burst_bytes >= SESSION_BROKER_ACTIVE_BURST_BYTES) {
active_burst_bytes = 0U;
/*
* A continuously readable UART must not make this priority-9
* task permanently runnable. One tick after each bounded burst
* preserves 1 Mbaud headroom while allowing idle and transports
* to run on a loaded dual-core system.
*/
vTaskDelay(1U);
}
}
}
}