⚡ Removes max file upload and secure getWsClients
This commit is contained in:
@@ -26,7 +26,7 @@ class NativeServer {
|
||||
NativeServer();
|
||||
~NativeServer();
|
||||
|
||||
void config(size_t maxUriHandlers, size_t stackSize, size_t maxUploadSize);
|
||||
void config(size_t maxUriHandlers, size_t stackSize);
|
||||
esp_err_t listen(uint16_t port);
|
||||
void stop();
|
||||
|
||||
@@ -42,7 +42,7 @@ class NativeServer {
|
||||
esp_err_t wsSendAll(const uint8_t* data, size_t len);
|
||||
void addWsClient(int sockfd);
|
||||
void removeWsClient(int sockfd);
|
||||
std::vector<int>& getWsClients();
|
||||
std::vector<int> getWsClients();
|
||||
|
||||
void addDefaultHeader(const char* key, const char* value);
|
||||
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user