From fc378172e245b2c246e37adb914eb8bb724da3f4 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 29 Nov 2023 20:24:03 +0100 Subject: [PATCH] capabilities plugin: Make state tracking clearer in the MDH handler. --- src/capabilities.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/capabilities.c b/src/capabilities.c index c108d145d..2909d7b9e 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -203,10 +203,10 @@ static MHD_RESULT cap_http_handler(void *cls, struct MHD_Connection *connection, /* On the first call for each connection, return without anything further. * The first time only the headers are valid, do not respond in the first - * round. The docs are not very specific on the issue. */ + * round. */ if (*connection_state == NULL) { - /* set to a random non-NULL pointer. */ - *connection_state = (void *)1; + /* keep track of connection state */ + *connection_state = (void *)"called"; return MHD_YES; } DEBUG(CAP_PLUGIN ": formatted response: %s", g_cap_json); -- 2.47.2