Skip to content

Commit

Permalink
weblog buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 1, 2023
1 parent 2062703 commit c19885d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/web/WebLogService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,14 @@ void WebLogService::transmit(const QueuedLogMessage & message) {

// send the complete log buffer to the API, not filtering on log level
void WebLogService::fetchLog(AsyncWebServerRequest * request) {
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN + 192 * log_messages_.size());
// auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN + 192 * log_messages_.size());
size_t buffer = EMSESP_JSON_SIZE_XLARGE_DYN + 192 * log_messages_.size();
auto * response = new MsgpackAsyncJsonResponse(false, buffer);
while (!response->getSize()) {
delete response;
buffer -= 1024;
response = new MsgpackAsyncJsonResponse(false, buffer);
}
JsonObject root = response->getRoot();
JsonArray log = root.createNestedArray("events");

Expand Down

0 comments on commit c19885d

Please sign in to comment.