tuning logs, max queue size, preallocate strings, all working

This commit is contained in:
Torsten Ruger
2021-07-03 21:23:07 +03:00
parent 9c6b39fd50
commit 8f32fb0c94
2 changed files with 8 additions and 9 deletions

View File

@ -83,7 +83,8 @@ void server_setup(){
DEBUG_OUT.println("log start");
AsyncWebServerResponse *response = request->beginChunkedResponse("text/html", [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
if(debug_out.empty()) return 0;
String to_send = String(maxLen);
String to_send = String();
to_send.reserve(maxLen);
while(!debug_out.empty()){
String add_next = debug_out.first();
if( (add_next.length() + 5 + to_send.length() ) > maxLen ) break ; // dont overflow buffer