From 45b74f0cb6e6152f3a0e6cc7c93ee066a6256c1a Mon Sep 17 00:00:00 2001 From: Andrew Melvin Date: Thu, 28 Jan 2016 20:31:56 +0200 Subject: [PATCH] fix return in skip make setLength void make destructor virtual --- src/AsyncJson.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AsyncJson.h b/src/AsyncJson.h index 198a941..481a27b 100644 --- a/src/AsyncJson.h +++ b/src/AsyncJson.h @@ -38,7 +38,7 @@ class ChunkPrint : public Print{ size_t write(uint8_t c){ if (_to_skip > 0) { _to_skip--; - return 0; + return 1; } else if (_to_write > 0) { _to_write--; _destination[_pos++] = c; @@ -59,10 +59,10 @@ class AsyncJsonResponse: public AsyncAbstractResponse { _contentType = "text/json"; _root = _jsonBuffer.createObject(); } - ~AsyncJsonResponse() {} + virtual ~AsyncJsonResponse() {} JsonVariant & getRoot() { return _root; } bool _sourceValid() { return _isValid; } - bool setLength() { + void setLength() { _contentLength = _root.measureLength(); if (_contentLength) { _isValid = true; }