Skip to content

Commit

Permalink
Fix the undetectable timeout issue #203
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jan 13, 2025
1 parent 2708e7a commit 9b7cb82
Show file tree
Hide file tree
Showing 58 changed files with 67 additions and 61 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mobizt/FirebaseClient/.github%2Fworkflows%2Fcompile_library.yml?logo=github&label=compile) [![Github Stars](https://img.shields.io/github/stars/mobizt/FirebaseClient?logo=github)](https://github.com/mobizt/FirebaseClient/stargazers) ![Github Issues](https://img.shields.io/github/issues/mobizt/FirebaseClient?logo=github)

![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v1.4.17-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)
![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v1.4.18-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)

[![GitHub Sponsors](https://img.shields.io/github/sponsors/mobizt?logo=github)](https://github.com/sponsors/mobizt)

Revision `2025-01-09T02:03:14Z`
Revision `2025-01-13T05:09:36Z`

## Table of Contents

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.4.17",
"version": "1.4.18",
"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.17
version=1.4.18

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 @@ -2,7 +2,7 @@
* Created October 30, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/cloud_storage/CloudStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/cloud_storage/DataOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created October 29, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AppBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 25, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
12 changes: 9 additions & 3 deletions src/core/AsyncClient/AsyncClient.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Created January 8, 2025
* Created January 14, 2025
*
* For MCU build target (CORE_ARDUINO_XXXX), see Options.h.
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down Expand Up @@ -2309,11 +2309,17 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
while (sData->state == async_state_send_header || sData->state == async_state_send_payload)
{
sData->return_type = send(sData);
sData->response.feedTimer(!sData->async && sync_read_timeout_sec > 0 ? sync_read_timeout_sec : -1);
handleSendTimeout(sData);
if (sData->async || sData->return_type == function_return_type_failure)
break;
}

// The response time-out timer should be initiated here with appropriate timeout
// when the request was sucessfully sent (with or without payload).
// Without this initialization, the subsequent sData->response.feedTimer may not execute in case
// no server response returns because of server is out of reach or network/router is not responding.
if (sData->state == async_state_read_response)
sData->response.feedTimer(!sData->async && sync_read_timeout_sec > 0 ? sync_read_timeout_sec : -1);
}

if (sending)
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncClient/RequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncClient/ResponseHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AppData.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 5, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AppDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AppError.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AppEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AppProgress.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 2, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/AsyncResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/RTDBResultBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncResult/ResultBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AsyncTCPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/AuthConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* For MCU build target (CORE_ARDUINO_XXXX), see Options.h.
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
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.17"
#define FIREBASE_CLIENT_VERSION "1.4.18"

static void sys_idle()
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created July 1, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/FileConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/FirebaseApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/JSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created November 7, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/JWT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/JWT.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/List.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/NetConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 21, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* For MCU build target (CORE_ARDUINO_XXXX), see Options.h.
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/OTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* For MCU build target (CORE_ARDUINO_XXXX), see Options.h.
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/ObjectWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created July 1, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/StringUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/URL.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created June 12, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Updater/OTAUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created November 28, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/core/Updater/OTAUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created November 28, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
2 changes: 1 addition & 1 deletion src/database/DataOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created December 27, 2024
*
* The MIT License (MIT)
* Copyright (c) 2024 K. Suwatchai (Mobizt)
* Copyright (c) 2025 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of charge, to any person returning a copy of
Expand Down
Loading

0 comments on commit 9b7cb82

Please sign in to comment.