From cf97f1efdc00f64450b1f39ed6f58d60ccddf5fc Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Tue, 11 Jan 2022 20:40:48 -0500 Subject: [PATCH] v1.3.3 to fix libb64 fallthrough compile warning ### Releases v1.3.3 1. Fix libb64 `fallthrough` compile warning --- CONTRIBUTING.md | 2 +- README.md | 30 +++++++++---------- changelog.md | 5 ++++ library.json | 2 +- library.properties | 2 +- platformio/platformio.ini | 4 +-- src/EthernetHttpClient_STM32.h | 3 +- src/EthernetWebServer_STM32-impl.h | 3 +- src/EthernetWebServer_STM32.h | 9 +++--- .../Ethernet_HttpClient.cpp | 3 +- src/Ethernet_HTTPClient/Ethernet_HttpClient.h | 3 +- .../Ethernet_URLEncoder.cpp | 3 +- src/Ethernet_HTTPClient/Ethernet_URLEncoder.h | 3 +- .../Ethernet_WebSocketClient.cpp | 3 +- .../Ethernet_WebSocketClient.h | 3 +- src/Parsing_STM32-impl.h | 3 +- src/detail/Debug_STM32.h | 3 +- src/detail/RequestHandler_STM32.h | 3 +- src/detail/RequestHandlersImpl_STM32.h | 3 +- src/detail/mimetable.h | 3 +- src/libb64/base64.cpp | 3 +- src/libb64/base64.h | 3 +- src/libb64/cdecode.c | 23 +++++++++----- src/libb64/cdecode.h | 5 ++-- src/libb64/cencode.c | 13 ++++++-- src/libb64/cencode.h | 3 +- 26 files changed, 91 insertions(+), 52 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e45f44b..1f7a2b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ Please ensure to specify the following: Arduino IDE version: 1.8.19 STM32F7 Nucleo-144 NUCLEO_F767ZI, STM32 core v2.2.0 OS: Ubuntu 20.04 LTS -Linux xy-Inspiron-3593 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux +Linux xy-Inspiron-3593 5.4.0-94-generic #106-Ubuntu SMP Thu Jan 6 23:58:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux Context: I encountered a crash while trying to use the Timer Interrupt. diff --git a/README.md b/README.md index b793fe0..e1dc1b5 100644 --- a/README.md +++ b/README.md @@ -279,8 +279,8 @@ Check [`EthernetWebServer Library Issue: Support for STM32F Series`](https://git - [`Ethernet2 library v1.0.4+`](https://github.com/khoih-prog/Ethernet2) for W5500. [![GitHub release](https://img.shields.io/github/release/adafruit/Ethernet2.svg)](https://github.com/adafruit/Ethernet2/releases/latest) - [`Ethernet3 library v1.5.5+`](https://github.com/sstaub/Ethernet3) for W5500/WIZ550io/WIZ850io/USR-ES1 with Wiznet W5500 chip. [![GitHub release](https://img.shields.io/github/release/sstaub/Ethernet3.svg)](https://github.com/sstaub/Ethernet3/releases/latest) 6. For ENC28J60 Ethernet: - - [`EthernetENC library v2.0.1+`](https://github.com/jandrassy/EthernetENC) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/jandrassy/EthernetENC.svg)](https://github.com/jandrassy/EthernetENC/releases/latest). **New and Better** - - [`UIPEthernet library v2.0.10+`](https://github.com/UIPEthernet/UIPEthernet) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/UIPEthernet/UIPEthernet.svg)](https://github.com/UIPEthernet/UIPEthernet/releases/latest) + - [`EthernetENC library v2.0.2+`](https://github.com/jandrassy/EthernetENC) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/jandrassy/EthernetENC.svg)](https://github.com/jandrassy/EthernetENC/releases/latest). **New and Better** + - [`UIPEthernet library v2.0.11+`](https://github.com/UIPEthernet/UIPEthernet) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/UIPEthernet/UIPEthernet.svg)](https://github.com/UIPEthernet/UIPEthernet/releases/latest) --- @@ -1367,7 +1367,7 @@ Following is debug terminal output and screen shot when running example [Advance ``` Start AdvancedWebServer on NUCLEO_F767ZI, using LAN8742A Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 HTTP EthernetWebServer is @ IP : 192.168.2.117 EthernetWebServer::handleClient: New Client method: GET @@ -1491,7 +1491,7 @@ The following is debug terminal output when running example [WebClientRepeating] ``` Start WebClientRepeating on NUCLEO_F767ZI, using ENC28J60 & EthernetENC Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10 [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1566,7 +1566,7 @@ The following is debug terminal output when running example [UdpNTPClient](examp ``` Start UdpNTPClient on NUCLEO_F767ZI, using W5x00 & Ethernet2 Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10 [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1590,7 +1590,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet ``` Starting SimpleWebSocket on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] ========================= [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1635,7 +1635,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet3 ``` Starting SimpleWebSocket on NUCLEO_F767ZI with W5x00 & Ethernet3 Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] =========== USE_ETHERNET3 =========== [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1687,7 +1687,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet ``` Starting SimpleHTTPExample on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] ========================= [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1760,7 +1760,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet ``` Start MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] ========================= [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1799,7 +1799,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with ENC28J60 & Ethern ``` Start MQTTClient_Auth on NUCLEO_F767ZI with ENC28J60 & EthernetENC Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] =========== USE_ETHERNET_ENC =========== [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1838,7 +1838,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet2 ``` Start MQTTClient_Auth on NUCLEO_F767ZI with W5x00 & Ethernet2 Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 [ETHERNET_WEBSERVER] =========== USE_ETHERNET2 =========== [ETHERNET_WEBSERVER] Default SPI pinout: [ETHERNET_WEBSERVER] MOSI: 11 @@ -1872,7 +1872,7 @@ The terminal output of **STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Eth ``` Starting SimpleWebSocket_LAN8720 on BLACK_F407VE with LAN8720 Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 Using mac index = 6 Connected! IP address: 192.168.2.138 starting WebSocket client @@ -1897,7 +1897,7 @@ The terminal output of **BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet L ``` Start WebClient_LAN8720 on BLACK_F407VE, using LAN8720 Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 You're connected to the network, IP = 192.168.2.139 Starting connection to server... @@ -1970,7 +1970,7 @@ Following is debug terminal output and screen shot when running example [Advance ``` Start AdvancedWebServer_LAN8720 on BLACK_F407VE, using LAN8720 Ethernet & STM32Ethernet Library -EthernetWebServer_STM32 v1.3.2 +EthernetWebServer_STM32 v1.3.3 .[EWS] String Len = 0, extend to 2048 ......... .......... .......... .......... .......... .......... .......... .......... ``` @@ -2038,7 +2038,7 @@ Submit issues to: [EthernetWebServer_STM32 issues](https://github.com/khoih-prog 8. Add support to **Ethernet LAN8720** using [STM32Ethernet library](https://github.com/stm32duino/STM32Ethernet), for boards such as **Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG), Discovery (DISCO_F746NG)** and **STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)** 9. Reduce usage of Arduino String with std::string 10. Optimize library code and examples by using **reference-passing instead of value-passing** - +11. Fix authenticate issue and compiler warmings caused by libb64 --- diff --git a/changelog.md b/changelog.md index 4259941..666ed69 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,7 @@ ## Table of Contents * [Changelog](#changelog) + * [Releases v1.3.3](#releases-v133) * [Releases v1.3.2](#releases-v132) * [Releases v1.3.1](#releases-v131) * [Major Releases v1.3.0](#major-releases-v130) @@ -31,6 +32,10 @@ ## Changelog +### Releases v1.3.3 + +1. Fix libb64 `fallthrough` compile warning + ### Releases v1.3.2 1. Fix wrong http status header bug. Check [fix for wrong http status header #42](https://github.com/khoih-prog/EthernetWebServer/pull/42) diff --git a/library.json b/library.json index d1a3a33..d624263 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "EthernetWebServer_STM32", - "version": "1.3.2", + "version": "1.3.3", "keywords": "WebServer, built-in-Ethernet, STM32F, STM32L, STM32H, STM32G, STM32WB, STM32MP1, Ethernet-shield, Nucleo-144, Nucleo-64, Nucleo-32, LAN8742A, LAN8720, ENC28J60, W5x00, W5500, W5100, Ethernet, Ethernet2, Ethernet3, EthernetLarge, EtnernetENC, UIPEthernet, HTTP-Client, WebSocket-Client, server, client, websocket", "description": "Simple Ethernet WebServer, HTTP Client and WebSocket Client library for STM32F/L/H/G/WB/MP1 boards running built-in Ethernet LAN8742A, LAN8720 or Ethernet W5x00, ENC28J60 shields", "authors": diff --git a/library.properties b/library.properties index 4065ec6..55db232 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=EthernetWebServer_STM32 -version=1.3.2 +version=1.3.3 author=Khoi Hoang license=MIT maintainer=Khoi Hoang diff --git a/platformio/platformio.ini b/platformio/platformio.ini index e01f97f..d1239df 100644 --- a/platformio/platformio.ini +++ b/platformio/platformio.ini @@ -39,7 +39,7 @@ lib_deps = EthernetLarge@~2.0.0 Ethernet2@~1.0.4 Ethernet3@~1.5.5 - EthernetENC@~2.0.1 + EthernetENC@~2.0.2 ; PlatformIO 5.x ; stm32duino/STM32duino LwIP@~2.1.2 ; stm32duino/STM32duino STM32Ethernet@~1.2.0 @@ -49,7 +49,7 @@ lib_deps = ; PaulStoffregen/EthernetLarge@~2.0.0 ; adafruit/Ethernet2@~1.0.4 ; sstaub/Ethernet3@~1.5.5 -; jandrassy/EthernetENC@~2.0.1 +; jandrassy/EthernetENC@~2.0.2 build_flags = ; set your build_flags diff --git a/src/EthernetHttpClient_STM32.h b/src/EthernetHttpClient_STM32.h index 0ef5ce9..7a0c58b 100644 --- a/src/EthernetHttpClient_STM32.h +++ b/src/EthernetHttpClient_STM32.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // Library to simplify HTTP fetching on Arduino diff --git a/src/EthernetWebServer_STM32-impl.h b/src/EthernetWebServer_STM32-impl.h index 8684098..e9a4db9 100644 --- a/src/EthernetWebServer_STM32-impl.h +++ b/src/EthernetWebServer_STM32-impl.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/EthernetWebServer_STM32.h b/src/EthernetWebServer_STM32.h index 3f72dcd..b384dea 100644 --- a/src/EthernetWebServer_STM32.h +++ b/src/EthernetWebServer_STM32.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once @@ -59,13 +60,13 @@ #endif -#define ETHERNET_WEBSERVER_STM32_VERSION "EthernetWebServer_STM32 v1.3.2" +#define ETHERNET_WEBSERVER_STM32_VERSION "EthernetWebServer_STM32 v1.3.3" #define ETHERNET_WEBSERVER_STM32_VERSION_MAJOR 1 #define ETHERNET_WEBSERVER_STM32_VERSION_MINOR 3 -#define ETHERNET_WEBSERVER_STM32_VERSION_PATCH 2 +#define ETHERNET_WEBSERVER_STM32_VERSION_PATCH 3 -#define ETHERNET_WEBSERVER_STM32_VERSION_INT 1003002 +#define ETHERNET_WEBSERVER_STM32_VERSION_INT 1003003 #define USE_NEW_WEBSERVER_VERSION true diff --git a/src/Ethernet_HTTPClient/Ethernet_HttpClient.cpp b/src/Ethernet_HTTPClient/Ethernet_HttpClient.cpp index 828a71d..e0ec98e 100644 --- a/src/Ethernet_HTTPClient/Ethernet_HttpClient.cpp +++ b/src/Ethernet_HTTPClient/Ethernet_HttpClient.cpp @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // Class to simplify HTTP fetching on Arduino diff --git a/src/Ethernet_HTTPClient/Ethernet_HttpClient.h b/src/Ethernet_HTTPClient/Ethernet_HttpClient.h index e9d6941..9e66fae 100644 --- a/src/Ethernet_HTTPClient/Ethernet_HttpClient.h +++ b/src/Ethernet_HTTPClient/Ethernet_HttpClient.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // Class to simplify HTTP fetching on Arduino diff --git a/src/Ethernet_HTTPClient/Ethernet_URLEncoder.cpp b/src/Ethernet_HTTPClient/Ethernet_URLEncoder.cpp index 8257311..0e26e9d 100644 --- a/src/Ethernet_HTTPClient/Ethernet_URLEncoder.cpp +++ b/src/Ethernet_HTTPClient/Ethernet_URLEncoder.cpp @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // Library to simplify HTTP fetching on Arduino diff --git a/src/Ethernet_HTTPClient/Ethernet_URLEncoder.h b/src/Ethernet_HTTPClient/Ethernet_URLEncoder.h index 1171700..1eb5e7f 100644 --- a/src/Ethernet_HTTPClient/Ethernet_URLEncoder.h +++ b/src/Ethernet_HTTPClient/Ethernet_URLEncoder.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // Library to simplify HTTP fetching on Arduino diff --git a/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.cpp b/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.cpp index b974b7f..76e258c 100644 --- a/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.cpp +++ b/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.cpp @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // (c) Copyright Arduino. 2016 diff --git a/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.h b/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.h index f5c2eca..d0510da 100644 --- a/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.h +++ b/src/Ethernet_HTTPClient/Ethernet_WebSocketClient.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ // (c) Copyright Arduino. 2016 diff --git a/src/Parsing_STM32-impl.h b/src/Parsing_STM32-impl.h index a0c2bc3..a03d8e9 100644 --- a/src/Parsing_STM32-impl.h +++ b/src/Parsing_STM32-impl.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/detail/Debug_STM32.h b/src/detail/Debug_STM32.h index 80e6b6f..e068233 100644 --- a/src/detail/Debug_STM32.h +++ b/src/detail/Debug_STM32.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/detail/RequestHandler_STM32.h b/src/detail/RequestHandler_STM32.h index 06f1fb6..9400242 100644 --- a/src/detail/RequestHandler_STM32.h +++ b/src/detail/RequestHandler_STM32.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/detail/RequestHandlersImpl_STM32.h b/src/detail/RequestHandlersImpl_STM32.h index 608012a..a8524b4 100644 --- a/src/detail/RequestHandlersImpl_STM32.h +++ b/src/detail/RequestHandlersImpl_STM32.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/detail/mimetable.h b/src/detail/mimetable.h index cf76884..8099937 100644 --- a/src/detail/mimetable.h +++ b/src/detail/mimetable.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/libb64/base64.cpp b/src/libb64/base64.cpp index 75cb543..35fbe74 100644 --- a/src/libb64/base64.cpp +++ b/src/libb64/base64.cpp @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #include "base64.h" diff --git a/src/libb64/base64.h b/src/libb64/base64.h index 0206081..1d51bbf 100644 --- a/src/libb64/base64.h +++ b/src/libb64/base64.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *************************************************************************************************************************************/ #pragma once diff --git a/src/libb64/cdecode.c b/src/libb64/cdecode.c index 110d5ac..f5d4dc7 100644 --- a/src/libb64/cdecode.c +++ b/src/libb64/cdecode.c @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,11 +31,12 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *****************************************************************************************************************************/ #include "cdecode.h" -int base64_decode_value(char value_in) +int base64_decode_value(int value_in) { static const char decoding[] = { 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, @@ -63,7 +64,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex { const char* codechar = code_in; char* plainchar = plaintext_out; - char fragment; + int fragment; *plainchar = state_in->plainchar; @@ -81,10 +82,12 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar = (fragment & 0x03f) << 2; + + // fall through case step_b: do @@ -96,11 +99,13 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x030) >> 4; *plainchar = (fragment & 0x00f) << 4; + + // fall through case step_c: do @@ -112,11 +117,13 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x03c) >> 2; *plainchar = (fragment & 0x003) << 6; + + // fall through case step_d: do @@ -128,10 +135,12 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x03f); + + // fall through } } diff --git a/src/libb64/cdecode.h b/src/libb64/cdecode.h index 827d0a2..a1d6556 100644 --- a/src/libb64/cdecode.h +++ b/src/libb64/cdecode.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *****************************************************************************************************************************/ #pragma once @@ -59,7 +60,7 @@ typedef struct void base64_init_decodestate(base64_decodestate* state_in); -int base64_decode_value(char value_in); +int base64_decode_value(int value_in); int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); diff --git a/src/libb64/cencode.c b/src/libb64/cencode.c index 5ec6f09..4eff80f 100644 --- a/src/libb64/cencode.c +++ b/src/libb64/cencode.c @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *****************************************************************************************************************************/ #include "cencode.h" @@ -51,7 +52,7 @@ char base64_encode_value(char value_in) if (value_in > 63) return '='; - return encoding[(int)value_in]; + return encoding[(unsigned int)value_in]; } int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) @@ -80,6 +81,8 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, result = (fragment & 0x0fc) >> 2; *codechar++ = base64_encode_value(result); result = (fragment & 0x003) << 4; + + // fall through case step_B: if (plainchar == plaintextend) @@ -93,7 +96,9 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, result |= (fragment & 0x0f0) >> 4; *codechar++ = base64_encode_value(result); result = (fragment & 0x00f) << 2; - + + // fall through + case step_C: if (plainchar == plaintextend) { @@ -115,6 +120,8 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, *codechar++ = '\n'; state_in->stepcount = 0; } + + // fall through } } diff --git a/src/libb64/cencode.h b/src/libb64/cencode.h index 4ab0c78..9d4652b 100644 --- a/src/libb64/cencode.h +++ b/src/libb64/cencode.h @@ -12,7 +12,7 @@ @file Esp8266WebServer.h @author Ivan Grokhotkov - Version: 1.3.2 + Version: 1.3.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -31,6 +31,7 @@ 1.3.0 K Hoang 20/12/2021 Reduce usage of Arduino String with std::string. Use reference passing instead of value-passing 1.3.1 K Hoang 25/12/2021 Fix bug 1.3.2 K Hoang 28/12/2021 Fix wrong http status header bug and authenticate issue caused by libb64 + 1.3.3 K Hoang 11/01/2022 Fix libb64 fallthrough compile warning *****************************************************************************************************************************/ #pragma once