From da841f800572b984c7383c4284d846f23f19c513 Mon Sep 17 00:00:00 2001 From: Junxiao Shi Date: Sun, 5 Jan 2025 22:06:27 -0500 Subject: [PATCH] asyncweb: move to mathieucarbou/AsyncTCP --- .github/workflows/build.yml | 8 ++++---- LICENSE | 2 +- examples/AsyncCam/handlers.cpp | 4 ++-- src/esp32cam-asyncweb.h | 10 +++++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1119454..517426c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: fqbn: esp32:esp32:esp32cam libraries: | - source-path: ./ - - source-url: https://github.com/me-no-dev/AsyncTCP.git - version: 58cbe1fabe78977e3140391c01c03f0cb51e347c - - source-url: https://github.com/me-no-dev/ESPAsyncWebServer.git - version: 7f3753454b1f176c4b6d6bcd1587a135d95ca63c + - name: Async TCP + - name: ESP Async WebServer + # https://github.com/mathieucarbou/AsyncTCP + # https://github.com/mathieucarbou/ESPAsyncWebServer - name: Build docs run: docs/build.sh - name: Deploy docs diff --git a/LICENSE b/LICENSE index 05f43f4..8b4a9df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2020-2024, Junxiao Shi +Copyright (c) 2020-2025, Junxiao Shi Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/examples/AsyncCam/handlers.cpp b/examples/AsyncCam/handlers.cpp index b200769..83af41c 100644 --- a/examples/AsyncCam/handlers.cpp +++ b/examples/AsyncCam/handlers.cpp @@ -86,8 +86,8 @@ rewriteFrontpage(const String& var) { void addRequestHandlers() { server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) { - request->send_P(200, "text/html", reinterpret_cast(FRONTPAGE), - sizeof(FRONTPAGE), rewriteFrontpage); + request->send(200, "text/html", reinterpret_cast(FRONTPAGE), sizeof(FRONTPAGE), + rewriteFrontpage); }); server.on("/robots.txt", HTTP_GET, [](AsyncWebServerRequest* request) { diff --git a/src/esp32cam-asyncweb.h b/src/esp32cam-asyncweb.h index 0157edd..f506b20 100644 --- a/src/esp32cam-asyncweb.h +++ b/src/esp32cam-asyncweb.h @@ -4,8 +4,8 @@ #include "esp32cam.h" #include -#include -#include +#include +#include #ifdef ESP32CAM_ASYNCWEB_LOGGER #define ESP32CAM_ASYNCWEB_LOG(fmt, ...) \ @@ -22,7 +22,7 @@ namespace esp32cam { /** * @brief esp32cam integration with ESPAsyncWebServer library. - * @sa https://github.com/me-no-dev/ESPAsyncWebServer + * @sa https://github.com/mathieucarbou/ESPAsyncWebServer */ namespace asyncweb { @@ -103,6 +103,10 @@ class StillResponse : public AsyncAbstractResponse { * * To perform authentication or other operations before image capture, create another HTTP handler * to do these, and then call this function. + * + * @bug + * This handler is currently broken: ESPAsyncWebServer expects request->send(response) to be + * called before this function returns; otherwise it will generate 501 response. */ inline void handleStill(AsyncWebServerRequest* request) {