Skip to content

Commit

Permalink
Fix WiFiSSLClient session reuse issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Apr 7, 2024
1 parent 6a1c00d commit 91e4003
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ When the authentication async operation was required, it will insert to the firs

If the sync operation was called, it will insert to the first slot in the queue too but after the authentication task slot.

When async Get operation in SSE mode (HTTP Streaming) was currently stored in queue, the new sync and async operations will be inserted before the async SSE (HTTP Streaming) slot.
When async Get operation in `SSE mode (HTTP Streaming)` was currently stored in queue, the new sync and async operations will be inserted before the async `SSE (HTTP Streaming)` slot.

When the async operation queue is full, the new sync and async operations will be cancelled.
When the async operation queue is full or the another SSE mode get function was called, the new sync and async operations will be cancelled. The error code `-118` (`FIREBASE_ERROR_OPERATION_CANCELLED`) or `"operation was cancelled"` will show in the debug message.

The finished and time out operating slot will be removed from the queue unless the async SSE and allow the vacant slot for the new async operation.

The async SSE operation will run continuously and repeatedly as long as the FirebaseApp and the services app
(Database, Firestore, Messaging, Functions, Storage and CloudStorage) objects was run in the loop via app.loop() or database.loop().
The async `SSE` operation will run continuously and repeatedly as long as the FirebaseApp and the services app
(Database, Firestore, Messaging, Functions, Storage and CloudStorage) objects was run in the loop via `app.loop()` or `Database.loop()`.

### Async Client

Expand Down
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.0.10",
"version": "1.0.11",
"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.0.10
version=1.0.11

author=Mobizt

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

#define FIREBASE_CLIENT_VERSION "1.0.10"
#define FIREBASE_CLIENT_VERSION "1.0.11"

#include <Arduino.h>
#include "./core/FirebaseApp.h"
Expand Down
4 changes: 4 additions & 0 deletions src/core/AsyncClient/AsyncClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,8 @@ class AsyncClientClass
{
setAsyncError(sData, sData->state, FIREBASE_ERROR_TCP_SEND, !sData->sse, false);
sData->return_type = function_return_type_failure;
// This requires by WiFiSSLClient before stating a new connection in case session was reused.
reset(sData, true);
return true;
}
return false;
Expand All @@ -1752,6 +1754,8 @@ class AsyncClientClass
{
setAsyncError(sData, sData->state, FIREBASE_ERROR_TCP_RECEIVE_TIMEOUT, !sData->sse, false);
sData->return_type = function_return_type_failure;
// This requires by WiFiSSLClient before stating a new connection in case session was reused.
reset(sData, true);
return true;
}
return false;
Expand Down

0 comments on commit 91e4003

Please sign in to comment.