diff --git a/examples/regex_patterns/build_opt.h b/examples/regex_patterns/build_opt.h new file mode 100644 index 000000000..f59785169 --- /dev/null +++ b/examples/regex_patterns/build_opt.h @@ -0,0 +1 @@ +-DASYNCWEBSERVER_REGEX=1 \ No newline at end of file diff --git a/library.json b/library.json index 750ca28d2..7947a4d3b 100644 --- a/library.json +++ b/library.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/me-no-dev/ESPAsyncWebServer.git" }, - "version": "1.2.3", + "version": "1.2.4", "license": "LGPL-3.0", "frameworks": "arduino", "platforms": ["espressif8266", "espressif32"], diff --git a/library.properties b/library.properties index 401b04173..fb650fa21 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP Async WebServer -version=1.2.3 +version=1.2.4 author=Me-No-Dev maintainer=Me-No-Dev sentence=Async Web Server for ESP8266 and ESP31B diff --git a/src/AsyncEventSource.cpp b/src/AsyncEventSource.cpp index f2914df54..3b825750e 100644 --- a/src/AsyncEventSource.cpp +++ b/src/AsyncEventSource.cpp @@ -19,6 +19,11 @@ */ #include "Arduino.h" #include "AsyncEventSource.h" +#ifdef ESP32 +#if ESP_IDF_VERSION_MAJOR >= 5 +#include "rom/ets_sys.h" +#endif +#endif static String generateEventMessage(const char *message, const char *event, uint32_t id, uint32_t reconnect){ String ev = ""; diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index f76f2fc96..bdfa19718 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -28,6 +28,11 @@ #else #include #endif +#ifdef ESP32 +#if ESP_IDF_VERSION_MAJOR >= 5 +#include "rom/ets_sys.h" +#endif +#endif #define MAX_PRINTF_LEN 64 @@ -829,7 +834,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer) IPAddress AsyncWebSocketClient::remoteIP() { if(!_client) { - return IPAddress(0U); + return IPAddress((uint32_t)0U); } return _client->remoteIP(); } @@ -1259,9 +1264,15 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String& key, AsyncWebSocket (String&)key += WS_STR_UUID; mbedtls_sha1_context ctx; mbedtls_sha1_init(&ctx); +#if ESP_IDF_VERSION_MAJOR < 5 mbedtls_sha1_starts_ret(&ctx); mbedtls_sha1_update_ret(&ctx, (const unsigned char*)key.c_str(), key.length()); mbedtls_sha1_finish_ret(&ctx, hash); +#else + mbedtls_sha1_starts(&ctx); + mbedtls_sha1_update(&ctx, (const unsigned char*)key.c_str(), key.length()); + mbedtls_sha1_finish(&ctx, hash); +#endif mbedtls_sha1_free(&ctx); #endif base64_encodestate _state; diff --git a/src/WebAuthentication.cpp b/src/WebAuthentication.cpp index 45246a196..38b20f37c 100644 --- a/src/WebAuthentication.cpp +++ b/src/WebAuthentication.cpp @@ -71,9 +71,15 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo memset(_buf, 0x00, 16); #ifdef ESP32 mbedtls_md5_init(&_ctx); +#if ESP_IDF_VERSION_MAJOR < 5 mbedtls_md5_starts_ret(&_ctx); mbedtls_md5_update_ret(&_ctx, data, len); mbedtls_md5_finish_ret(&_ctx, _buf); +#else + mbedtls_md5_starts(&_ctx); + mbedtls_md5_update(&_ctx, data, len); + mbedtls_md5_finish(&_ctx, _buf); +#endif #else MD5Init(&_ctx); MD5Update(&_ctx, data, len);