mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
webbuffer 12k to reduce http:507 messages
This commit is contained in:
@@ -80,7 +80,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EMSESP_JSON_SIZE_XXLARGE_DYN 16384 // for extra very very large json docs, using DynamicJsonDocument
|
#define EMSESP_JSON_SIZE_XXLARGE_DYN 16384 // for extra very very large json docs, using DynamicJsonDocument
|
||||||
#define EMSESP_JSON_SIZE_XXXLARGE_DYN 20480 // web output (maybe for 4 hc)
|
#define EMSESP_JSON_SIZE_XXXLARGE_DYN 12288 // web output (maybe for 4 hc)
|
||||||
|
|
||||||
// helpers for callback functions
|
// helpers for callback functions
|
||||||
#define MAKE_PF_CB(__f) [&](std::shared_ptr<const Telegram> t) { __f(t); } // for Process Function callbacks to EMSDevice::process_function_p
|
#define MAKE_PF_CB(__f) [&](std::shared_ptr<const Telegram> t) { __f(t); } // for Process Function callbacks to EMSDevice::process_function_p
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
|||||||
// send back list of device entities
|
// send back list of device entities
|
||||||
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||||
if (json.is<JsonObject>()) {
|
if (json.is<JsonObject>()) {
|
||||||
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
||||||
if (!response->getSize()) {
|
if (!response->getSize()) {
|
||||||
delete response;
|
delete response;
|
||||||
response = new MsgpackAsyncJsonResponse(true, 256);
|
response = new MsgpackAsyncJsonResponse(true, 256);
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
|||||||
// Compresses the JSON using MsgPack https://msgpack.org/index.html
|
// Compresses the JSON using MsgPack https://msgpack.org/index.html
|
||||||
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
|
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||||
if (json.is<JsonObject>()) {
|
if (json.is<JsonObject>()) {
|
||||||
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
||||||
if (!response->getSize()) {
|
if (!response->getSize()) {
|
||||||
delete response;
|
delete response;
|
||||||
response = new MsgpackAsyncJsonResponse(false, 256);
|
response = new MsgpackAsyncJsonResponse(false, 256);
|
||||||
|
|||||||
Reference in New Issue
Block a user