Skip to content

Commit f73ef83

Browse files
Merge branch 'main' into WebDAVMethods
2 parents bdc9287 + e0ddc99 commit f73ef83

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESPAsyncWebServer",
3-
"version": "3.9.5",
3+
"version": "3.9.6",
44
"description": "Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040. Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.",
55
"keywords": "http,async,websocket,webserver",
66
"homepage": "https://github.com/ESP32Async/ESPAsyncWebServer",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=ESP Async WebServer
22
includes=ESPAsyncWebServer.h
3-
version=3.9.5
3+
version=3.9.6
44
author=ESP32Async
55
maintainer=ESP32Async
66
sentence=Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040

pioarduino_examples/IncreaseMaxSockets/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ lib_compat_mode = strict
1818
lib_ldf_mode = chain
1919
lib_deps =
2020
ESP32Async/AsyncTCP @ 3.4.10
21-
ESP32Async/ESpAsyncWebServer @ 3.9.5
21+
ESP32Async/ESpAsyncWebServer @ 3.9.6
2222
custom_component_remove =
2323
espressif/esp_hosted
2424
espressif/esp_wifi_remote

src/AsyncWebServerLogging.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@
8181

8282
/**
8383
* ESP8266 specific configurations
84+
* Uses ets_printf to avoid dependency on global Serial object.
85+
* Format strings are stored in PROGMEM and copied to a stack buffer.
8486
*/
8587
#elif defined(ESP8266)
8688
#include <ets_sys.h>
89+
#include <pgmspace.h>
8790
// define log levels
8891
#define ASYNC_WS_LOG_NONE 0 /*!< No log output */
8992
#define ASYNC_WS_LOG_ERROR 1 /*!< Critical errors, software module can not recover on its own */
@@ -96,33 +99,42 @@
9699
#ifndef ASYNCWEBSERVER_LOG_LEVEL
97100
#define ASYNCWEBSERVER_LOG_LEVEL ASYNC_WS_LOG_INFO
98101
#endif
102+
// helper macro to copy PROGMEM format string to stack and call ets_printf
103+
// level is a char literal ('E', 'W', etc.) to avoid RAM usage from string literals
104+
#define _ASYNC_WS_LOG(level, format, ...) \
105+
do { \
106+
static const char __fmt[] PROGMEM = "%c async_ws %d: " format "\n"; \
107+
char __buf[sizeof(__fmt)]; \
108+
strcpy_P(__buf, __fmt); \
109+
ets_printf(__buf, level, __LINE__, ##__VA_ARGS__); \
110+
} while (0)
99111
// error
100112
#if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_ERROR
101-
#define async_ws_log_e(format, ...) Serial.printf_P(PSTR("E async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__)
113+
#define async_ws_log_e(format, ...) _ASYNC_WS_LOG('E', format, ##__VA_ARGS__)
102114
#else
103115
#define async_ws_log_e(format, ...)
104116
#endif
105117
// warn
106118
#if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_WARN
107-
#define async_ws_log_w(format, ...) Serial.printf_P(PSTR("W async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__)
119+
#define async_ws_log_w(format, ...) _ASYNC_WS_LOG('W', format, ##__VA_ARGS__)
108120
#else
109121
#define async_ws_log_w(format, ...)
110122
#endif
111123
// info
112124
#if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_INFO
113-
#define async_ws_log_i(format, ...) Serial.printf_P(PSTR("I async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__)
125+
#define async_ws_log_i(format, ...) _ASYNC_WS_LOG('I', format, ##__VA_ARGS__)
114126
#else
115127
#define async_ws_log_i(format, ...)
116128
#endif
117129
// debug
118130
#if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_DEBUG
119-
#define async_ws_log_d(format, ...) Serial.printf_P(PSTR("D async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__)
131+
#define async_ws_log_d(format, ...) _ASYNC_WS_LOG('D', format, ##__VA_ARGS__)
120132
#else
121133
#define async_ws_log_d(format, ...)
122134
#endif
123135
// verbose
124136
#if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_VERBOSE
125-
#define async_ws_log_v(format, ...) Serial.printf_P(PSTR("V async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__)
137+
#define async_ws_log_v(format, ...) _ASYNC_WS_LOG('V', format, ##__VA_ARGS__)
126138
#else
127139
#define async_ws_log_v(format, ...)
128140
#endif

src/AsyncWebServerVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
/** Minor version number (x.X.x) */
1313
#define ASYNCWEBSERVER_VERSION_MINOR 9
1414
/** Patch version number (x.x.X) */
15-
#define ASYNCWEBSERVER_VERSION_PATCH 5
15+
#define ASYNCWEBSERVER_VERSION_PATCH 6
1616

1717
/**
1818
* Macro to convert version number into an integer

0 commit comments

Comments
 (0)