kopia lustrzana https://github.com/Aircoookie/WLED
serveLiveLeds: Use variable buffer size
Allocate the serialization buffer size at the required length, rather than always allocating the maximum size.pull/3828/head
rodzic
2640203c88
commit
8b6bf08a23
|
@ -1152,7 +1152,7 @@ bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient)
|
|||
}
|
||||
#endif
|
||||
|
||||
DynamicBuffer buffer(9 + (9*MAX_LIVE_LEDS) + 7 + 5 + 6 + 5 + 6 + 5 + 2);
|
||||
DynamicBuffer buffer(9 + (9*(1+(used/n))) + 7 + 5 + 6 + 5 + 6 + 5 + 2);
|
||||
char* buf = buffer.data(); // assign buffer for oappnd() functions
|
||||
strncpy_P(buffer.data(), PSTR("{\"leds\":["), buffer.size());
|
||||
buf += 9; // sizeof(PSTR()) from last line
|
||||
|
|
Ładowanie…
Reference in New Issue