Removes max file upload and secure getWsClients

This commit is contained in:
Rune Harlyk
2026-01-24 13:06:38 +01:00
committed by Rune Harlyk
parent 92b2d326c7
commit 57e80655cf
3 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -17,7 +17,7 @@ NativeServer::~NativeServer() {
vSemaphoreDelete(wsMutex_);
}
void NativeServer::config(size_t maxUriHandlers, size_t stackSize, size_t maxUploadSize) {
void NativeServer::config(size_t maxUriHandlers, size_t stackSize) {
config_.max_uri_handlers = maxUriHandlers;
config_.stack_size = stackSize;
config_.max_resp_headers = 16;
@@ -252,7 +252,12 @@ void NativeServer::removeWsClient(int sockfd) {
xSemaphoreGive(wsMutex_);
}
std::vector<int>& NativeServer::getWsClients() { return wsClients_; }
std::vector<int> NativeServer::getWsClients() {
xSemaphoreTake(wsMutex_, portMAX_DELAY);
std::vector<int> clients = wsClients_;
xSemaphoreGive(wsMutex_);
return clients;
}
esp_err_t NativeServer::wsSend(int sockfd, const uint8_t* data, size_t len) {
httpd_ws_frame_t frame = {.final = true,
+1 -1
View File
@@ -40,7 +40,7 @@ WiFiService wifiService;
APService apService;
void setupServer() {
nativeServer.config(50 + WWW_ASSETS_COUNT, 32768, 1000000);
nativeServer.config(50 + WWW_ASSETS_COUNT, 32768);
nativeServer.listen(80);
nativeServer.on("/api/system/reset", HTTP_POST,