This commit is contained in:
cjkas 2026-03-18 15:28:49 +01:00
parent 16175f2b9b
commit 07369e7e4c
4 changed files with 11 additions and 6 deletions

View file

@ -46,12 +46,15 @@ void JsonResponse::endResponse() {
server->sendContent("", 0);
}
void JsonResponse::send() {
Serial.println("JsonResponse::send start ");
unsigned long ts = millis();
esp_task_wdt_reset();
if(!this->_headersSent) server->send_P(200, "application/json", this->buff);
else server->sendContent(this->buff);
//Serial.printf("Sent %d bytes %d\n", strlen(this->buff), this->buffSize);
this->buff[0] = 0x00;
this->_headersSent = true;
Serial.printf("JsonResponse::send end took %d ms\n", millis() - ts);
}
void JsonResponse::_safecat(const char *val, bool escape) {
size_t len = (escape ? this->calcEscapedLength(val) : strlen(val)) + strlen(this->buff);