fix: use max connection count as max client count
All checks were successful
Build ESP32 BMC Firmware / build (push) Successful in 57s
All checks were successful
Build ESP32 BMC Firmware / build (push) Successful in 57s
This commit is contained in:
@@ -72,7 +72,6 @@ static const bmc_gpio_def_t bmc_gpio_defaults[BMC_GPIO_COUNT] = {
|
|||||||
// Power Control Timing
|
// Power Control Timing
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
#define BMC_RESET_PULSE_MS 200
|
#define BMC_RESET_PULSE_MS 200
|
||||||
#define BMC_POWER_GOOD_DELAY_MS 2000
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Logging Tags
|
// Logging Tags
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
static const char *TAG = TAG_HTTP;
|
static const char *TAG = TAG_HTTP;
|
||||||
|
#define MAX_WS_COUNT_CLIENTS BMC_HTTP_MAX_CONN
|
||||||
|
#define MAX_WS_BROADCAST_CLIENTS BMC_HTTP_MAX_CONN
|
||||||
|
|
||||||
// Server handle
|
// Server handle
|
||||||
static httpd_handle_t server = NULL;
|
static httpd_handle_t server = NULL;
|
||||||
@@ -946,8 +948,7 @@ esp_err_t web_server_ws_broadcast(const uint8_t *data, size_t len) {
|
|||||||
.final = true,
|
.final = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Use a fixed-size array to avoid stack issues
|
// Use a fixed-size array to avoid stack issues
|
||||||
#define MAX_WS_BROADCAST_CLIENTS 4
|
|
||||||
int client_fds[MAX_WS_BROADCAST_CLIENTS];
|
int client_fds[MAX_WS_BROADCAST_CLIENTS];
|
||||||
size_t clients = MAX_WS_BROADCAST_CLIENTS;
|
size_t clients = MAX_WS_BROADCAST_CLIENTS;
|
||||||
|
|
||||||
@@ -955,7 +956,7 @@ esp_err_t web_server_ws_broadcast(const uint8_t *data, size_t len) {
|
|||||||
esp_err_t ret = httpd_get_client_list(server, &clients, client_fds);
|
esp_err_t ret = httpd_get_client_list(server, &clients, client_fds);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
// This can happen when there are no clients or server is busy - not a critical error
|
// This can happen when there are no clients or server is busy - not a critical error
|
||||||
ESP_LOGD(TAG, "Could not get client list: %s (may be no clients connected)", esp_err_to_name(ret));
|
ESP_LOGI(TAG, "Could not get client list: %s (may be no clients connected)", esp_err_to_name(ret));
|
||||||
return ESP_OK; // Return OK since this is not a critical error
|
return ESP_OK; // Return OK since this is not a critical error
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -987,7 +988,6 @@ int web_server_ws_client_count(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_WS_COUNT_CLIENTS 4
|
|
||||||
int client_fds[MAX_WS_COUNT_CLIENTS];
|
int client_fds[MAX_WS_COUNT_CLIENTS];
|
||||||
size_t clients = MAX_WS_COUNT_CLIENTS;
|
size_t clients = MAX_WS_COUNT_CLIENTS;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user