Skip to content

Commit 263caa2

Browse files
committed
bug fix for esp8266 webconfig
1 parent f453d38 commit 263caa2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=thinger.io
2-
version=2.5.8
2+
version=2.5.9
33
author=Alvaro Luis Bustamante <[email protected]>
44
maintainer=Thinger.io <[email protected]>
55
sentence=Arduino library for the Thinger.io Internet of Things Platform.

src/ThingerWebConfig.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class pson_spiffs_decoder : public protoson::pson_decoder{
3838

3939
protected:
4040
virtual bool read(void* buffer, size_t size){
41-
file_.readBytes((char*)buffer, size);
42-
protoson::pson_decoder::read(buffer, size);
43-
return true;
41+
size_t read = file_.readBytes((char*)buffer, size);
42+
protoson::pson_decoder::read(buffer, read);
43+
return read == size;
4444
}
4545

4646
private:
@@ -54,9 +54,10 @@ class pson_spiffs_encoder : public protoson::pson_encoder{
5454
}
5555

5656
protected:
57-
virtual void write(const void* buffer, size_t size){
58-
file_.write((const uint8_t*)buffer, size);
59-
protoson::pson_encoder::write(buffer, size);
57+
virtual bool write(const void* buffer, size_t size){
58+
size_t wrote = file_.write((const uint8_t*)buffer, size);
59+
protoson::pson_encoder::write(buffer, wrote);
60+
return wrote == size;
6061
}
6162

6263
private:

0 commit comments

Comments
 (0)