Skip to content

Commit 1d154df

Browse files
committed
Disable ASYNCWEBSERVER_USE_CHUNK_INFLIGHT by default and updated doc
1 parent fca0939 commit 1d154df

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- env: ci-arduino-3-no-json
110110
board: esp32dev
111111

112-
- env: ci-arduino-3-no-chunk-inflight
112+
- env: ci-arduino-3-chunk-inflight
113113
board: esp32dev
114114

115115
- env: ci-esp8266

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ I personally use the following configuration in my projects:
208208
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096 // reduce the stack size (default is 16K)
209209
```
210210

211+
If you need to server long / slow requests using chunk encoding (like fiel download from SD Card), you might need to set `-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1`.
212+
211213
## `AsyncWebSocketMessageBuffer` and `makeBuffer()`
212214

213215
The fork from [yubox-node-org](https://github.com/yubox-node-org/ESPAsyncWebServer) introduces some breaking API changes compared to the original library, especially regarding the use of `std::shared_ptr<std::vector<uint8_t>>` for WebSocket.

platformio.ini

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ lib_deps =
5050
; board = esp32-s3-devkitc-1
5151
; board = esp32-c6-devkitc-1
5252

53-
[env:arduino-3-no-chunk-inflight]
53+
[env:arduino-3-chunk-inflight]
5454
build_flags = ${env.build_flags}
55-
-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=0
55+
-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1
5656

5757
[env:perf-test-AsyncTCP]
5858
build_flags = ${env.build_flags}
@@ -98,10 +98,10 @@ board = ${sysenv.PIO_BOARD}
9898
lib_deps =
9999
ESP32Async/AsyncTCP @ 3.3.2
100100

101-
[env:ci-arduino-3-no-chunk-inflight]
101+
[env:ci-arduino-3-chunk-inflight]
102102
board = ${sysenv.PIO_BOARD}
103103
build_flags = ${env.build_flags}
104-
-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=0
104+
-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1
105105

106106
[env:ci-esp8266]
107107
platform = espressif8266

src/ESPAsyncWebServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
// See https://github.com/ESP32Async/ESPAsyncWebServer/commit/3d3456e9e81502a477f6498c44d0691499dda8f9#diff-646b25b11691c11dce25529e3abce843f0ba4bd07ab75ec9eee7e72b06dbf13fR388-R392
6464
// This setting slowdown chunk serving but avoids crashing or deadlocks in the case where slow chunk responses are created, like file serving form SD Card
6565
#ifndef ASYNCWEBSERVER_USE_CHUNK_INFLIGHT
66-
#define ASYNCWEBSERVER_USE_CHUNK_INFLIGHT 1
66+
#define ASYNCWEBSERVER_USE_CHUNK_INFLIGHT 0
6767
#endif
6868

6969
class AsyncWebServer;

0 commit comments

Comments
 (0)