From 6dc0cb2b6a4e35beb70abb435ac231584a91d54f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 14 Oct 2023 15:40:21 +0200 Subject: [PATCH] Add new CivetWeb patch Signed-off-by: DL6ER --- patch/civetweb.sh | 1 + ...es-to-webserver.log-when-debug.webse.patch | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 patch/civetweb/0001-Log-debug-messages-to-webserver.log-when-debug.webse.patch diff --git a/patch/civetweb.sh b/patch/civetweb.sh index b2c0fa6e..d292b253 100644 --- a/patch/civetweb.sh +++ b/patch/civetweb.sh @@ -8,5 +8,6 @@ patch -p1 < patch/civetweb/0001-Add-FTL-URI-rewriting-changes-to-CivetWeb.patch patch -p1 < patch/civetweb/0001-Add-mbedTLS-debug-logging-hook.patch patch -p1 < patch/civetweb/0001-Register-CSRF-token-in-conn-request_info.patch patch -p1 < patch/civetweb/0001-Do-not-try-to-guess-server-hostname-in-Civetweb-when.patch +patch -p1 < patch/civetweb/0001-Log-debug-messages-to-webserver.log-when-debug.webse.patch echo "ALL PATCHES APPLIED OKAY" diff --git a/patch/civetweb/0001-Log-debug-messages-to-webserver.log-when-debug.webse.patch b/patch/civetweb/0001-Log-debug-messages-to-webserver.log-when-debug.webse.patch new file mode 100644 index 00000000..c396cb0f --- /dev/null +++ b/patch/civetweb/0001-Log-debug-messages-to-webserver.log-when-debug.webse.patch @@ -0,0 +1,54 @@ +From 445aed4fd5ef53a52ac974aa5123ba56b11d8a1f Mon Sep 17 00:00:00 2001 +From: DL6ER +Date: Sat, 14 Oct 2023 15:39:21 +0200 +Subject: [PATCH] Log debug messages to webserver.log when debug.webserver is + true + +Signed-off-by: DL6ER +--- + src/webserver/civetweb/civetweb.c | 5 +++-- + src/webserver/civetweb/mod_mbedtls.inl | 4 ++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/webserver/civetweb/civetweb.c b/src/webserver/civetweb/civetweb.c +index 3df8eab9..9b0c6308 100644 +--- a/src/webserver/civetweb/civetweb.c ++++ b/src/webserver/civetweb/civetweb.c +@@ -239,9 +239,10 @@ static void DEBUG_TRACE_FUNC(const char *func, + #endif + + #else ++#include "log.h" + #define DEBUG_TRACE(fmt, ...) \ +- do { \ +- } while (0) ++ if(debug_flags[DEBUG_WEBSERVER]) {\ ++ log_web("DEBUG: " fmt " (%s:%d)", ##__VA_ARGS__, short_path(__FILE__), __LINE__); } + #endif /* DEBUG */ + #endif /* DEBUG_TRACE */ + +diff --git a/src/webserver/civetweb/mod_mbedtls.inl b/src/webserver/civetweb/mod_mbedtls.inl +index 00b9280a..6a450ba3 100644 +--- a/src/webserver/civetweb/mod_mbedtls.inl ++++ b/src/webserver/civetweb/mod_mbedtls.inl +@@ -213,7 +213,7 @@ mbed_ssl_accept(mbedtls_ssl_context **ssl, + return -1; + } + +- DEBUG_TRACE("TLS connection %p accepted, state: %d", ssl, (*ssl)->state); ++ DEBUG_TRACE("TLS connection %p accepted, state: %d", ssl, (*ssl)->MBEDTLS_PRIVATE(state)); + return 0; + } + +@@ -239,7 +239,7 @@ mbed_ssl_handshake(mbedtls_ssl_context *ssl) + } + } + +- DEBUG_TRACE("TLS handshake rc: %d, state: %d", rc, ssl->state); ++ DEBUG_TRACE("TLS handshake rc: %d, state: %d", rc, ssl->MBEDTLS_PRIVATE(state)); + return rc; + } + +-- +2.34.1 +