refactor: optimizations & fixes

This commit is contained in:
Yurii
2024-11-11 15:45:36 +03:00
parent 24a46f4c16
commit c6df74f06e
9 changed files with 244 additions and 205 deletions

View File

@@ -77,10 +77,19 @@ public:
return;
}
this->webServer->sendContent((const char*)this->buffer, this->bufferPos);
this->bufferPos = 0;
#ifdef ARDUINO_ARCH_ESP8266
::delay(0);
::optimistic_yield(1000);
#endif
auto& client = this->webServer->client();
if (client.connected()) {
this->webServer->sendContent((const char*)this->buffer, this->bufferPos);
}
this->bufferPos = 0;
#ifdef ARDUINO_ARCH_ESP8266
::optimistic_yield(1000);
#endif
}