Skip to content

Commit

Permalink
Fix chunked data issue #201
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jan 7, 2025
1 parent 70f335f commit 3145e2d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FirebaseClient",
"version": "1.4.14",
"version": "1.4.15",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "Async Firebase Client library for Arduino.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=FirebaseClient

version=1.4.14
version=1.4.15

author=Mobizt

Expand Down
12 changes: 6 additions & 6 deletions src/core/AsyncClient/AsyncClient.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Created January 6, 2025
* Created January 7, 2025
*
* For MCU build target (CORE_ARDUINO_XXXX), see Options.h.
*
Expand Down Expand Up @@ -1083,8 +1083,8 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
if (read >= 2 && line[read - 2] == '\r' && line[read - 1] == '\n')
{
// last chunk?
if (line[0] == '0') // last-chunk , chunk-extension (if any) and CRLF
goto next;
if (line[0] == '0')
return -1;

// remove the \r\n
line.remove(line.length() - 2);
Expand All @@ -1111,7 +1111,6 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
else
{

next:
read = readLine(sData, line);

// CRLF (end of chunked body)
Expand Down Expand Up @@ -1336,8 +1335,9 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
sData->aResult.download_data.downloaded = sData->response.payloadRead;
returnResult(sData, false);
}

// Don't reset the payload remaining flag in case chunked

// Don't reset the payload remaining flag in case of chunked.
// It should set in readPayload when decodeChunks return -1.
if (!sData->response.flags.chunks)
sData->response.flags.payload_remaining = false;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#undef FIREBASE_CLIENT_VERSION
#endif

#define FIREBASE_CLIENT_VERSION "1.4.14"
#define FIREBASE_CLIENT_VERSION "1.4.15"

static void sys_idle()
{
Expand Down

0 comments on commit 3145e2d

Please sign in to comment.