From 16013ef0331982169e3662ca2adc50d1d3a79cec Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Thu, 23 Jan 2025 09:19:23 +0100 Subject: [PATCH] fix: Set ASYNCWEBSERVER_USE_CHUNK_INFLIGHT to 1 by default See explanation here: /~https://github.com/ESP32Async/ESPAsyncWebServer/pull/7#issuecomment-2608866686 --- .github/workflows/ci.yml | 2 +- README.md | 2 +- platformio.ini | 6 +++--- src/ESPAsyncWebServer.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c383d983..b0e457e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: - env: ci-arduino-3-no-json board: esp32dev - - env: ci-arduino-3-chunk-inflight + - env: ci-arduino-3-no-chunk-inflight board: esp32dev - env: ci-esp8266 diff --git a/README.md b/README.md index c876e189..2d3bb1b4 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ I personally use the following configuration in my projects: -D CONFIG_ASYNC_TCP_STACK_SIZE=4096 // reduce the stack size (default is 16K) ``` -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`. +If you need to serve chunk requests with a really low buffer (which should be avoided), you can set `-D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=0` to disable the in-flight control. ## `AsyncWebSocketMessageBuffer` and `makeBuffer()` diff --git a/platformio.ini b/platformio.ini index fe147c41..1a9b505b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,9 +50,9 @@ lib_deps = ; board = esp32-s3-devkitc-1 ; board = esp32-c6-devkitc-1 -[env:arduino-3-chunk-inflight] +[env:arduino-3-no-chunk-inflight] build_flags = ${env.build_flags} - -D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1 + -D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=0 [env:perf-test-AsyncTCP] build_flags = ${env.build_flags} @@ -98,7 +98,7 @@ board = ${sysenv.PIO_BOARD} lib_deps = ESP32Async/AsyncTCP @ 3.3.2 -[env:ci-arduino-3-chunk-inflight] +[env:ci-arduino-3-no-chunk-inflight] board = ${sysenv.PIO_BOARD} build_flags = ${env.build_flags} -D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1 diff --git a/src/ESPAsyncWebServer.h b/src/ESPAsyncWebServer.h index e97db115..560bad5c 100644 --- a/src/ESPAsyncWebServer.h +++ b/src/ESPAsyncWebServer.h @@ -63,7 +63,7 @@ // See /~https://github.com/ESP32Async/ESPAsyncWebServer/commit/3d3456e9e81502a477f6498c44d0691499dda8f9#diff-646b25b11691c11dce25529e3abce843f0ba4bd07ab75ec9eee7e72b06dbf13fR388-R392 // 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 #ifndef ASYNCWEBSERVER_USE_CHUNK_INFLIGHT - #define ASYNCWEBSERVER_USE_CHUNK_INFLIGHT 0 + #define ASYNCWEBSERVER_USE_CHUNK_INFLIGHT 1 #endif class AsyncWebServer;