ESPAsyncWebServer
ESPAsyncWebServer copied to clipboard
String handling causes - 'Reallocating large String' warnings
- framework-arduinoespressif8266 @ 3.30102.0 (3.1.2)
Warnings for reallocating strings, caused by repeated concatenation which can lead to fragmentation are now flagged.
The WebResponses.cpp file does it here
String AsyncWebServerResponse::_assembleHead(uint8_t version){
if(version){
addHeader("Accept-Ranges","none");
if(_chunked)
addHeader("Transfer-Encoding","chunked");
}
String out = String();
It then goes on to append various things to String variable out.
To remedy this, adding out.reserve(200); just after the variable definition seems to handle it.
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.