mirror of
https://github.com/wled/WLED.git
synced 2025-07-27 12:46:38 +00:00
Async response bugfix.
This commit is contained in:
parent
1bc15a8507
commit
b93d72296c
@ -914,7 +914,10 @@ void serveJson(AsyncWebServerRequest* request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AsyncJsonResponse* response = new AsyncJsonResponse(JSON_BUFFER_SIZE);
|
//AsyncJsonResponse* response = new AsyncJsonResponse(JSON_BUFFER_SIZE);
|
||||||
|
while (jsonBufferLock) delay(1);
|
||||||
jsonBufferLock = true;
|
jsonBufferLock = true;
|
||||||
|
doc.clear();
|
||||||
|
|
||||||
AsyncJsonResponse *response = new AsyncJsonResponse(&doc);
|
AsyncJsonResponse *response = new AsyncJsonResponse(&doc);
|
||||||
JsonObject lDoc = response->getRoot();
|
JsonObject lDoc = response->getRoot();
|
||||||
|
|
||||||
|
@ -68,9 +68,9 @@ class AsyncJsonResponse: public AsyncAbstractResponse {
|
|||||||
_code = 200;
|
_code = 200;
|
||||||
_contentType = JSON_MIMETYPE;
|
_contentType = JSON_MIMETYPE;
|
||||||
if(isArray)
|
if(isArray)
|
||||||
_root = ref->as<JsonArray>();
|
_root = ref->to<JsonArray>();
|
||||||
else
|
else
|
||||||
_root = ref->as<JsonObject>();
|
_root = ref->to<JsonObject>();
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncJsonResponse(size_t maxJsonBufferSize = DYNAMIC_JSON_DOCUMENT_SIZE, bool isArray=false) : _jsonBuffer(maxJsonBufferSize), _isValid{false} {
|
AsyncJsonResponse(size_t maxJsonBufferSize = DYNAMIC_JSON_DOCUMENT_SIZE, bool isArray=false) : _jsonBuffer(maxJsonBufferSize), _isValid{false} {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2111041
|
#define VERSION 2111051
|
||||||
|
|
||||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||||
//#define WLED_USE_MY_CONFIG
|
//#define WLED_USE_MY_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user