From 0a20a6989f1fe00ae797c5b0f86d47cef5d23052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Wed, 13 Oct 2021 17:07:55 -0500 Subject: [PATCH] Add dummy secure server API For AsyncTCP compatibility with ESPAsyncWebServer. --- src/AsyncTCP.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/AsyncTCP.h b/src/AsyncTCP.h index de34757..b6fa6fa 100644 --- a/src/AsyncTCP.h +++ b/src/AsyncTCP.h @@ -250,6 +250,10 @@ class AsyncClient : public AsyncSocketBase friend void _tcpsock_dns_found(const char * name, struct ip_addr * ipaddr, void * arg); }; +#if ASYNC_TCP_SSL_ENABLED +typedef std::function AcSSlFileHandler; +#endif + class AsyncServer : public AsyncSocketBase { public: @@ -257,6 +261,11 @@ class AsyncServer : public AsyncSocketBase AsyncServer(uint16_t port); ~AsyncServer(); void onClient(AcConnectHandler cb, void* arg); +#if ASYNC_TCP_SSL_ENABLED + // Dummy, so it compiles with ESP Async WebServer library enabled. + void onSslFileRequest(AcSSlFileHandler cb, void* arg) {}; + void beginSecure(const char *cert, const char *private_key_file, const char *password) {}; +#endif void begin(); void end();